]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: hinic: add missing destroy_workqueue in hinic_pf_to_mgmt_init
authorZheng Bin <zhengbin13@huawei.com>
Fri, 13 May 2022 07:09:22 +0000 (15:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:21:09 +0000 (10:21 +0200)
[ Upstream commit 382d917bfc1e92339dae3c8a636b2730e8bb5132 ]

hinic_pf_to_mgmt_init misses destroy_workqueue in error path,
this patch fixes that.

Fixes: 6dbb89014dc3 ("hinic: fix sending mailbox timeout in aeq event work")
Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c

index 819fa13034c0595bf6afa9b45490512dd51d0ee9..027dcc4535065a4593ae0fde3e02e93da410d2d4 100644 (file)
@@ -647,6 +647,7 @@ int hinic_pf_to_mgmt_init(struct hinic_pf_to_mgmt *pf_to_mgmt,
        err = alloc_msg_buf(pf_to_mgmt);
        if (err) {
                dev_err(&pdev->dev, "Failed to allocate msg buffers\n");
+               destroy_workqueue(pf_to_mgmt->workq);
                hinic_health_reporters_destroy(hwdev->devlink_dev);
                return err;
        }
@@ -654,6 +655,7 @@ int hinic_pf_to_mgmt_init(struct hinic_pf_to_mgmt *pf_to_mgmt,
        err = hinic_api_cmd_init(pf_to_mgmt->cmd_chain, hwif);
        if (err) {
                dev_err(&pdev->dev, "Failed to initialize cmd chains\n");
+               destroy_workqueue(pf_to_mgmt->workq);
                hinic_health_reporters_destroy(hwdev->devlink_dev);
                return err;
        }