amt: fix error return code in amt_init()
Return error code when alloc_workqueue() fails in amt_init(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Taehee Yoo <ap420073@gmail.com> Link: https://lore.kernel.org/r/20211102130353.1666999-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
18635d5248
commit
db2434343b
|
@ -3259,8 +3259,10 @@ static int __init amt_init(void)
|
|||
goto unregister_notifier;
|
||||
|
||||
amt_wq = alloc_workqueue("amt", WQ_UNBOUND, 1);
|
||||
if (!amt_wq)
|
||||
if (!amt_wq) {
|
||||
err = -ENOMEM;
|
||||
goto rtnl_unregister;
|
||||
}
|
||||
|
||||
spin_lock_init(&source_gc_lock);
|
||||
spin_lock_bh(&source_gc_lock);
|
||||
|
|
Loading…
Reference in New Issue