From: Chaehyun Lim Date: Mon, 7 Sep 2015 15:36:36 +0000 (+0900) Subject: staging: wilc1000: linux_wlan.c: add kzalloc error check X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ac61ef86f971c3fd0d3aff59744423ff32c4fcca;p=linux-beck.git staging: wilc1000: linux_wlan.c: add kzalloc error check This patch adds error check if kzalloc is failed. Signed-off-by: Chaehyun Lim Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index de82a90c2949..d68b42cbd14c 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -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;