diff mbox

[1/4] staging: wilc1000: Modify null check routine

Message ID 1442479806-10737-1-git-send-email-tony.cho@atmel.com (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show

Commit Message

Tony Cho Sept. 17, 2015, 8:50 a.m. UTC
From: Leo Kim <leo.kim@atmel.com>

This patch modify null check routine.
- Null check error non return. (Handle_RcvdGnrlAsyncInfo)

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
 drivers/staging/wilc1000/host_interface.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Nicolas Ferre Sept. 17, 2015, 9:06 a.m. UTC | #1
Le 17/09/2015 10:50, Tony Cho a écrit :
> From: Leo Kim <leo.kim@atmel.com>
> 
> This patch modify null check routine.
> - Null check error non return. (Handle_RcvdGnrlAsyncInfo)

It doesn't parse...

Is it fixing a bug? What were the consequences without the return?

Bye,

> Signed-off-by: Leo Kim <leo.kim@atmel.com>
> Signed-off-by: Tony Cho <tony.cho@atmel.com>
> ---
>  drivers/staging/wilc1000/host_interface.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 6fdf392..a9eaa8f 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -2403,8 +2403,10 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler, tstrRcvdGnrlAsy
>  	s32 s32Err = 0;
>  	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
>  
> -	if (pstrWFIDrv == NULL)
> +	if (!pstrWFIDrv) {
>  		PRINT_ER("Driver handler is NULL\n");
> +		return -EFAULT;
> +	}
>  	PRINT_D(GENERIC_DBG, "Current State = %d,Received state = %d\n", pstrWFIDrv->enuHostIFstate,
>  		pstrRcvdGnrlAsyncInfo->pu8Buffer[7]);
>  
>
diff mbox

Patch

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 6fdf392..a9eaa8f 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2403,8 +2403,10 @@  static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler, tstrRcvdGnrlAsy
 	s32 s32Err = 0;
 	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
 
-	if (pstrWFIDrv == NULL)
+	if (!pstrWFIDrv) {
 		PRINT_ER("Driver handler is NULL\n");
+		return -EFAULT;
+	}
 	PRINT_D(GENERIC_DBG, "Current State = %d,Received state = %d\n", pstrWFIDrv->enuHostIFstate,
 		pstrRcvdGnrlAsyncInfo->pu8Buffer[7]);