mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 02:59:19 -04:00
staging: wilc1000: Modify null check routine
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bcabc6f328
commit
234837decb
@@ -2384,8 +2384,10 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler,
|
||||
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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user