aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ifb.c
diff options
context:
space:
mode:
authordingtianhong <dingtianhong@huawei.com>2013-07-11 07:04:06 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-11 15:00:05 -0400
commitf2966cd5691058b8674a20766525bedeaea9cbcf (patch)
tree2ca005e6fb807dbbe503b23bbfce86c3a3f4e307 /drivers/net/ifb.c
parent2c8a01894a12665d8059fad8f0a293c98a264121 (diff)
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)
291 291
292 rtnl_lock(); 292 rtnl_lock();
293 err = __rtnl_link_register(&ifb_link_ops); 293 err = __rtnl_link_register(&ifb_link_ops);
294 if (err < 0)
295 goto out;
294 296
295 for (i = 0; i < numifbs && !err; i++) { 297 for (i = 0; i < numifbs && !err; i++) {
296 err = ifb_init_one(i); 298 err = ifb_init_one(i);
@@ -298,6 +300,8 @@ static int __init ifb_init_module(void)
298 } 300 }
299 if (err) 301 if (err)
300 __rtnl_link_unregister(&ifb_link_ops); 302 __rtnl_link_unregister(&ifb_link_ops);
303
304out:
301 rtnl_unlock(); 305 rtnl_unlock();
302 306
303 return err; 307 return err;