Skip to content

Commit 3315b3a

Browse files
Yuan Cansmb49
authored andcommitted
drivers: net: qlcnic: Fix potential memory leak in qlcnic_sriov_init()
BugLink: https://bugs.launchpad.net/bugs/2003914 [ Upstream commit 01de112 ] If vp alloc failed in qlcnic_sriov_init(), all previously allocated vp needs to be freed. Fixes: f197a7a ("qlcnic: VF-PF communication channel implementation") Signed-off-by: Yuan Can <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent c4d8573 commit 3315b3a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs)
222222
return 0;
223223

224224
qlcnic_destroy_async_wq:
225+
while (i--)
226+
kfree(sriov->vf_info[i].vp);
225227
destroy_workqueue(bc->bc_async_wq);
226228

227229
qlcnic_destroy_trans_wq:

0 commit comments

Comments
 (0)