netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: microchip: sparx5: Fix missing destroy_workqueue of mact_queue
@ 2022-12-01 13:47 Qiheng Lin
  2022-12-02  8:06 ` Pavan Chebbi
  2022-12-03  4:59 ` Jakub Kicinski
  0 siblings, 2 replies; 5+ messages in thread
From: Qiheng Lin @ 2022-12-01 13:47 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni
  Cc: lars.povlsen, Steen.Hegelund, daniel.machon, UNGLinuxDriver,
	netdev, linux-arm-kernel, linux-kernel, Qiheng Lin

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()

Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
---
 drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
index eeac04b84638..b6bbb3c9bd7a 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
@@ -887,6 +887,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:
@@ -911,6 +913,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;
 }
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-03  4:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-01 13:47 [PATCH] net: microchip: sparx5: Fix missing destroy_workqueue of mact_queue Qiheng Lin
2022-12-02  8:06 ` Pavan Chebbi
2022-12-02 10:02   ` Pavan Chebbi
2022-12-02 10:34     ` Qiheng Lin
2022-12-03  4:59 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).