Commit db243434 authored by Yang Yingliang's avatar Yang Yingliang Committed by Jakub Kicinski

amt: fix error return code in amt_init()

Return error code when alloc_workqueue()
fails in amt_init().
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarTaehee Yoo <ap420073@gmail.com>
Link: https://lore.kernel.org/r/20211102130353.1666999-1-yangyingliang@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 18635d52
...@@ -3259,8 +3259,10 @@ static int __init amt_init(void) ...@@ -3259,8 +3259,10 @@ static int __init amt_init(void)
goto unregister_notifier; goto unregister_notifier;
amt_wq = alloc_workqueue("amt", WQ_UNBOUND, 1); amt_wq = alloc_workqueue("amt", WQ_UNBOUND, 1);
if (!amt_wq) if (!amt_wq) {
err = -ENOMEM;
goto rtnl_unregister; goto rtnl_unregister;
}
spin_lock_init(&source_gc_lock); spin_lock_init(&source_gc_lock);
spin_lock_bh(&source_gc_lock); spin_lock_bh(&source_gc_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment