aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQiheng Lin <linqiheng@huawei.com>2022-12-03 15:02:59 +0800
committerPaolo Abeni <pabeni@redhat.com>2022-12-06 11:50:49 +0100
commit7b8232bdb1789a257de3129a9bb08c69b93a17db (patch)
tree8cb3801207a52170bf9a42abc8960ce2de13fa38
parentee496694b9eea651ae1aa4c4667d886cdf74aa3b (diff)
downloadlinux-loongson-7b8232bdb1789a257de3129a9bb08c69b93a17db.tar.gz
net: microchip: sparx5: Fix missing destroy_workqueue of mact_queue
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>
-rw-r--r--drivers/net/ethernet/microchip/sparx5/sparx5_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
index eeac04b846382..b6bbb3c9bd7a4 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;
}