提交 01de1123 编写于 作者: Y Yuan Can 提交者: David S. Miller

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: f197a7aa ("qlcnic: VF-PF communication channel implementation")
Signed-off-by: NYuan Can <yuancan@huawei.com>
Reviewed-by: NLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a137f3f2
...@@ -221,6 +221,8 @@ int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs) ...@@ -221,6 +221,8 @@ int qlcnic_sriov_init(struct qlcnic_adapter *adapter, int num_vfs)
return 0; return 0;
qlcnic_destroy_async_wq: qlcnic_destroy_async_wq:
while (i--)
kfree(sriov->vf_info[i].vp);
destroy_workqueue(bc->bc_async_wq); destroy_workqueue(bc->bc_async_wq);
qlcnic_destroy_trans_wq: qlcnic_destroy_trans_wq:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册