]> git.itanic.dy.fi Git - linux-stable/commitdiff
net: microchip: sparx5: Fix missing destroy_workqueue of mact_queue
authorQiheng Lin <linqiheng@huawei.com>
Sat, 3 Dec 2022 07:02:59 +0000 (15:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:41:02 +0000 (11:41 +0100)
[ Upstream commit 7b8232bdb1789a257de3129a9bb08c69b93a17db ]

The mchp_sparx5_probe() won't destroy workqueue created by
create_singlethread_workqueue() in sparx5_start() when later
inits failed. Add destroy_workqueue in the cleanup_ports case,
also add it in mchp_sparx5_remove()

Fixes: b37a1bae742f ("net: sparx5: add mactable support")
Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
Link: https://lore.kernel.org/r/20221203070259.19560-1-linqiheng@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/microchip/sparx5/sparx5_main.c

index 30815c0e3f76a88d7e9c07a1c0fdd4a22e09f3ba..e58de119186a691d10b877b8c7ce8e354dd53497 100644 (file)
@@ -876,6 +876,8 @@ static int mchp_sparx5_probe(struct platform_device *pdev)
 
 cleanup_ports:
        sparx5_cleanup_ports(sparx5);
+       if (sparx5->mact_queue)
+               destroy_workqueue(sparx5->mact_queue);
 cleanup_config:
        kfree(configs);
 cleanup_pnode:
@@ -900,6 +902,7 @@ static int mchp_sparx5_remove(struct platform_device *pdev)
        sparx5_cleanup_ports(sparx5);
        /* Unregister netdevs */
        sparx5_unregister_notifier_blocks(sparx5);
+       destroy_workqueue(sparx5->mact_queue);
 
        return 0;
 }