From: Qiheng Lin Date: Sat, 3 Dec 2022 07:02:59 +0000 (+0800) Subject: net: microchip: sparx5: Fix missing destroy_workqueue of mact_queue X-Git-Tag: Proxmox-5.15.83-1~25 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=df717e3500a33e9a14bf6b188809af8c2df4e2a7;hp=4f00b2c87d1fa4fe15395d119d743fc1db5e63d3;p=mirror_ubuntu-jammy-kernel.git net: microchip: sparx5: Fix missing destroy_workqueue of mact_queue [ 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 Link: https://lore.kernel.org/r/20221203070259.19560-1-linqiheng@huawei.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin (cherry picked from commit 51c04945756aaffb986b162dd668a469e05ab257) Signed-off-by: Thomas Lamprecht --- diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c index 435ac224e38e..0463f20da17b 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c @@ -829,6 +829,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: @@ -852,6 +854,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; }