summaryrefslogtreecommitdiff
path: root/drivers/net/ifb.c
diff options
context:
space:
mode:
authordingtianhong <dingtianhong@huawei.com>2013-07-11 15:04:06 +0400
committerDavid S. Miller <davem@davemloft.net>2013-07-11 23:00:05 +0400
commitf2966cd5691058b8674a20766525bedeaea9cbcf (patch)
tree2ca005e6fb807dbbe503b23bbfce86c3a3f4e307 /drivers/net/ifb.c
parent2c8a01894a12665d8059fad8f0a293c98a264121 (diff)
downloadlinux-f2966cd5691058b8674a20766525bedeaea9cbcf.tar.xz
ifb: fix oops when loading the ifb failed
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: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ifb.c')
-rw-r--r--drivers/net/ifb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index a11f7a45cb5f..a3bed28197d2 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -291,6 +291,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);
@@ -298,6 +300,8 @@ static int __init ifb_init_module(void)
}
if (err)
__rtnl_link_unregister(&ifb_link_ops);
+
+out:
rtnl_unlock();
return err;