ifb: fix oops when loading the ifb failed
Subsystems (2)
PATCH 2/2 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 <[email protected]>
--- drivers/net/ifb.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ifb.c +4 -0
@@ -291,11 +291,15 @@ 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);if (err)__rtnl_link_unregister (&ifb_link_ops); + +out:rtnl_unlock ();return err;
Signature · 1 line
1.8.0
From: Ding Tianhong <[email protected]>
Date: Thu, 11 Jul 2013 19:04:06 +0800
Quoted 4 lines
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 <[email protected]>
Applied.