mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
drivers: net: qlcnic: Fix potential memory leak in qlcnic_sriov_init()
If vp alloc failed in qlcnic_sriov_init(), all previously allocated vp
needs to be freed.
Fixes: f197a7aa62
("qlcnic: VF-PF communication channel implementation")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a137f3f27f
commit
01de112332
1 changed files with 2 additions and 0 deletions
|
@ -221,6 +221,8 @@ int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs)
|
|||
return 0;
|
||||
|
||||
qlcnic_destroy_async_wq:
|
||||
while (i--)
|
||||
kfree(sriov->vf_info[i].vp);
|
||||
destroy_workqueue(bc->bc_async_wq);
|
||||
|
||||
qlcnic_destroy_trans_wq:
|
||||
|
|
Loading…
Reference in a new issue