All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: r8188eu: Remove unneeded if-null-free check
@ 2021-09-18  9:10 Jiapeng Chong
  2021-09-18  9:48 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-09-18  9:10 UTC (permalink / raw)
  To: Larry.Finger; +Cc: phil, gregkh, linux-staging, linux-kernel, Jiapeng Chong

Eliminate the following coccicheck warning:

./drivers/staging/r8188eu/os_dep/usb_intf.c:545:3-8: WARNING: NULL check
before some freeing functions is not needed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index d04d2f65..7e42a0a 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -541,9 +541,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
 	if (status != _SUCCESS) {
 		if (pnetdev)
 			rtw_free_netdev(pnetdev);
-		else if (padapter)
-			vfree(padapter);
-		padapter = NULL;
+		vfree(padapter);
 	}
 exit:
 	return padapter;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: r8188eu: Remove unneeded if-null-free check
  2021-09-18  9:10 [PATCH] staging: r8188eu: Remove unneeded if-null-free check Jiapeng Chong
@ 2021-09-18  9:48 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-09-18  9:48 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: Larry.Finger, phil, linux-staging, linux-kernel

On Sat, Sep 18, 2021 at 05:10:06PM +0800, Jiapeng Chong wrote:
> Eliminate the following coccicheck warning:
> 
> ./drivers/staging/r8188eu/os_dep/usb_intf.c:545:3-8: WARNING: NULL check
> before some freeing functions is not needed.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/staging/r8188eu/os_dep/usb_intf.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
> index d04d2f65..7e42a0a 100644
> --- a/drivers/staging/r8188eu/os_dep/usb_intf.c
> +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
> @@ -541,9 +541,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
>  	if (status != _SUCCESS) {
>  		if (pnetdev)
>  			rtw_free_netdev(pnetdev);
> -		else if (padapter)
> -			vfree(padapter);
> -		padapter = NULL;
> +		vfree(padapter);
>  	}
>  exit:
>  	return padapter;
> -- 
> 1.8.3.1
> 

You just changed how this function works. :(

Please be MUCH more careful, and fix your robot.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-18  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-18  9:10 [PATCH] staging: r8188eu: Remove unneeded if-null-free check Jiapeng Chong
2021-09-18  9:48 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.