Skip to content

Commit

Permalink
net: marvell: prestera: add missing destroy_workqueue() in prestera_m…
Browse files Browse the repository at this point in the history
…odule_init()

Add the missing destroy_workqueue() before return from
prestera_module_init() in the error handling case.

Fixes: 4394fbc ("net: marvell: prestera: handle fib notifications")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220322090236.1439649-1-yangyingliang@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Yang Yingliang authored and Jakub Kicinski committed Mar 23, 2022
1 parent e9e6fae commit 4a6806c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/marvell/prestera/prestera_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1032,8 +1032,10 @@ static int __init prestera_module_init(void)
return -ENOMEM;

prestera_owq = alloc_ordered_workqueue("prestera_ordered", 0);
if (!prestera_owq)
if (!prestera_owq) {
destroy_workqueue(prestera_wq);
return -ENOMEM;
}

return 0;
}
Expand Down

0 comments on commit 4a6806c

Please sign in to comment.