summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/huawei/hinic
diff options
context:
space:
mode:
authorZhengchao Shao <shaozhengchao@huawei.com>2022-10-19 17:57:53 +0800
committerJakub Kicinski <kuba@kernel.org>2022-10-20 21:09:47 -0700
commit363cc87767f6ddcfb9158ad2e2afa2f8d5c4b94e (patch)
tree0aaa22c50a2c3f10299c932a34dbf05142dca6a5 /drivers/net/ethernet/huawei/hinic
parent4c1f602df8956bc0decdafd7e4fc7eef50c550b1 (diff)
net: hinic: fix the issue of CMDQ memory leaks
When hinic_set_cmdq_depth() fails in hinic_init_cmdqs(), the cmdq memory is not released correctly. Fix it. Fixes: 72ef908bb3ff ("hinic: add three net_device_ops of vf") Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/huawei/hinic')
-rw-r--r--drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c
index 78190e88cd75..d39eec9c62bf 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c
@@ -924,7 +924,7 @@ int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif,
err_set_cmdq_depth:
hinic_ceq_unregister_cb(&func_to_io->ceqs, HINIC_CEQ_CMDQ);
-
+ free_cmdq(&cmdqs->cmdq[HINIC_CMDQ_SYNC]);
err_cmdq_ctxt:
hinic_wqs_cmdq_free(&cmdqs->cmdq_pages, cmdqs->saved_wqs,
HINIC_MAX_CMDQ_TYPES);