staging: wilc1000: host_int_init: fix kzalloc error check
authorChaehyun Lim <chaehyun.lim@gmail.com>
Tue, 22 Sep 2015 09:34:56 +0000 (18:34 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 00:29:51 +0000 (02:29 +0200)
This patch fixes error check when kzalloc is failed.
NULL comparison style is changed to use ! operator and
PRINT_ER is also removed.

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

index 3f922169d6e9103f70c8fbbe8b2ef20a880cc254..6b744a2c1f96a24b46b03fc020503e9adcfa7cdd 100644 (file)
@@ -6374,9 +6374,8 @@ s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv)
 
        /*Allocate host interface private structure*/
        pstrWFIDrv  = kzalloc(sizeof(tstrWILC_WFIDrv), GFP_KERNEL);
-       if (pstrWFIDrv == NULL) {
+       if (!pstrWFIDrv) {
                s32Error = -ENOMEM;
-               PRINT_ER("Failed to allocate memory\n");
                goto _fail_timer_2;
        }
        *phWFIDrv = pstrWFIDrv;