summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordingtianhong <dingtianhong@huawei.com>2013-07-11 19:04:06 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-28 16:30:01 -0700
commitf84ddbc58cfd8551757efe3c61242c4d6e9918ce (patch)
tree9448cf2e305df54974d37f965fb55a78e60ba408
parent629b1d3db71d24e52478b94c71202034eaefed80 (diff)
ifb: fix oops when loading the ifb failed
[ Upstream commit f2966cd5691058b8674a20766525bedeaea9cbcf ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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;