This patch removes the potential faults which may happen when unexpectedly
getting access to invalid pointer. Return error when the invalid memory is
accessed.
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        s32 s32Err = 0;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
 
-       if (pstrWFIDrv == NULL)
+       if (!pstrWFIDrv) {
                PRINT_ER("Driver handler is NULL\n");
+               return -ENODEV;
+       }
        PRINT_D(GENERIC_DBG, "Current State = %d,Received state = %d\n", pstrWFIDrv->enuHostIFstate,
                pstrRcvdGnrlAsyncInfo->pu8Buffer[7]);