Commit 5393c4b2 authored by dingtianhong's avatar dingtianhong Committed by Willy Tarreau

ifb: fix oops when loading the ifb failed

[ Upstream commit f2966cd5 ]

If __rtnl_link_register() return faild when loading the ifb, it will
take the wrong path and get oops, so fix it just like dummy.
Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent 8665a8c4
......@@ -269,6 +269,8 @@ static int __init ifb_init_module(void)
rtnl_lock();
err = __rtnl_link_register(&ifb_link_ops);
if (err < 0)
goto out;
for (i = 0; i < numifbs && !err; i++) {
err = ifb_init_one(i);
......@@ -276,6 +278,8 @@ static int __init ifb_init_module(void)
}
if (err)
__rtnl_link_unregister(&ifb_link_ops);
out:
rtnl_unlock();
return err;
......
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