staging: wilc1000: linux_wlan.c: add kzalloc error check
authorChaehyun Lim <chaehyun.lim@gmail.com>
Mon, 7 Sep 2015 15:36:36 +0000 (00:36 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 01:24:45 +0000 (18:24 -0700)
This patch adds error check if kzalloc is failed.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/linux_wlan.c

index de82a90c294985a096153a4cc5c7d2c766f3e6da..d68b42cbd14c706344a4b36174053b1213f03c46 100644 (file)
@@ -2251,6 +2251,8 @@ int wilc_netdev_init(void)
 
        /*create the common structure*/
        g_linux_wlan = kzalloc(sizeof(linux_wlan_t), GFP_KERNEL);
+       if (!g_linux_wlan)
+               return -ENOMEM;
 
        /*Reset interrupt count debug*/
        int_rcvdU = 0;