From: dingtianhong Date: Thu, 11 Jul 2013 11:04:06 +0000 (+0800) Subject: ifb: fix oops when loading the ifb failed X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f2966cd5691058b8674a20766525bedeaea9cbcf;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: David S. Miller --- 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;