Skip to content

Commit

Permalink
net: microchip: sparx5: Fix missing destroy_workqueue of mact_queue
Browse files Browse the repository at this point in the history
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: b37a1ba ("net: sparx5: add mactable support")
Signed-off-by: Qiheng Lin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
ATRiiX authored and Paolo Abeni committed Dec 6, 2022
1 parent ee49669 commit 7b8232b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/microchip/sparx5/sparx5_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
}
Expand Down

0 comments on commit 7b8232b

Please sign in to comment.