diff options
author | dingtianhong <dingtianhong@huawei.com> | 2013-07-11 19:04:06 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-28 16:18:42 -0700 |
commit | 8956c3efefa2a61df16a47ba4f159e3d49717858 (patch) | |
tree | 3719d8a14ba1db38a9e003f9f94de9e5015b2818 /drivers | |
parent | 7474f8cdc7a60fe7c5d2579f99ec04232f76a208 (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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ifb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 280f4a8fca97..902ba2f61b00 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c @@ -252,6 +252,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); @@ -259,6 +261,8 @@ static int __init ifb_init_module(void) } if (err) __rtnl_link_unregister(&ifb_link_ops); + +out: rtnl_unlock(); return err; |