Staging: wlan-ng: Fix smatch warning potential null reference
authorTugce Sirin <ztugcesirin@gmail.com>
Wed, 19 Mar 2014 16:49:52 +0000 (18:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Mar 2014 20:41:27 +0000 (13:41 -0700)
This patch fixes potential null dereference 'wlandev' in wlan-ng driver.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Tugce Sirin <ztugcesirin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2sta.c

index ebe53723a41dc03fe23cb5314d097604e5cce211..f9ccf2371dba0a40f8cea7324d9b95f7cf765898 100644 (file)
@@ -1924,7 +1924,7 @@ static wlandevice_t *create_wlan(void)
        hw = kzalloc(sizeof(hfa384x_t), GFP_KERNEL);
 
        if (!wlandev || !hw) {
-               netdev_err(wlandev->netdev, "%s: Memory allocation failure.\n", dev_info);
+               pr_err("%s: Memory allocation failure.\n", dev_info);
                kfree(wlandev);
                kfree(hw);
                return NULL;