lkml.org 
[lkml]   [2018]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] rtl8712: add a check for the status of register_netdev
    Date
    register_netdev() may fail, so let's check its return value, and if it
    fails, issue an error message.

    Signed-off-by: Kangjie Lu <kjlu@umn.edu>
    ---
    drivers/staging/rtl8712/hal_init.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/drivers/staging/rtl8712/hal_init.c b/drivers/staging/rtl8712/hal_init.c
    index 7cdd609cab6c..7e2f8e0185d5 100644
    --- a/drivers/staging/rtl8712/hal_init.c
    +++ b/drivers/staging/rtl8712/hal_init.c
    @@ -45,7 +45,8 @@ static void rtl871x_load_fw_cb(const struct firmware *firmware, void *context)
    }
    padapter->fw = firmware;
    /* firmware available - start netdev */
    - register_netdev(padapter->pnetdev);
    + if (register_netdev(padapter->pnetdev))
    + dev_err(&udev->dev, "r8712u: Registering netdev failed\n");
    }

    static const char firmware_file[] = "rtlwifi/rtl8712u.bin";
    --
    2.17.2 (Apple Git-113)
    \
     
     \ /
      Last update: 2018-12-26 02:32    [W:28.476 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site