lkml.org 
[lkml]   [2013]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 38/59] ifb: fix oops when loading the ifb failed
    Date
    3.4-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: dingtianhong <dingtianhong@huawei.com>

    [ 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>
    ---
    drivers/net/ifb.c | 4 ++++
    1 file changed, 4 insertions(+)

    --- a/drivers/net/ifb.c
    +++ b/drivers/net/ifb.c
    @@ -290,6 +290,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);
    @@ -297,6 +299,8 @@ static int __init ifb_init_module(void)
    }
    if (err)
    __rtnl_link_unregister(&ifb_link_ops);
    +
    +out:
    rtnl_unlock();

    return err;



    \
     
     \ /
      Last update: 2013-07-26 23:41    [W:2.462 / U:0.368 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site