From ac61ef86f971c3fd0d3aff59744423ff32c4fcca Mon Sep 17 00:00:00 2001 From: Chaehyun Lim Date: Tue, 8 Sep 2015 00:36:36 +0900 Subject: [PATCH] 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 --- drivers/staging/wilc1000/linux_wlan.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.39.5