All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: r8188eu: Remove null checking before freeing functions
@ 2022-06-26  7:44 ` SebinSebastian
  0 siblings, 0 replies; 4+ messages in thread
From: SebinSebastian @ 2022-06-26  7:44 UTC (permalink / raw)
  Cc: mailmesebin00, skhan, Larry Finger, Phillip Potter,
	Greg Kroah-Hartman, Martin Kaiser, Michael Straube,
	Pavel Skripkin, linux-staging, linux-kernel

Fix the following coccicheck warning:
drivers/staging/r8188eu/os_dep/usb_intf.c:376:2-7: WARNING: NULL check before some freeing functions is not needed.

Signed-off-by: Sebin Sebastian <mailmesebin00@gmail.com>
---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 68869c5daeff..f5f1119b5444 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -372,8 +372,8 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
 free_adapter:
 	if (pnetdev)
 		rtw_free_netdev(pnetdev);
-	else if (padapter)
-		vfree(padapter);
+	
+	vfree(padapter);
 
 	return NULL;
 }
-- 
2.34.1


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

* [PATCH] staging: r8188eu: Remove null checking before freeing functions
@ 2022-06-26  7:44 ` SebinSebastian
  0 siblings, 0 replies; 4+ messages in thread
From: SebinSebastian @ 2022-06-26  7:44 UTC (permalink / raw)
  Cc: mailmesebin00, skhan, Larry Finger, Phillip Potter,
	Greg Kroah-Hartman, Martin Kaiser, Michael Straube,
	Pavel Skripkin, linux-staging, linux-kernel

Fix the following coccicheck warning:
drivers/staging/r8188eu/os_dep/usb_intf.c:376:2-7: WARNING: NULL check before some freeing functions is not needed.

Signed-off-by: Sebin Sebastian <mailmesebin00@gmail.com>
---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 68869c5daeff..f5f1119b5444 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -372,8 +372,8 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
 free_adapter:
 	if (pnetdev)
 		rtw_free_netdev(pnetdev);
-	else if (padapter)
-		vfree(padapter);
+	
+	vfree(padapter);
 
 	return NULL;
 }
-- 
2.34.1


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

* Re: [PATCH] staging: r8188eu: Remove null checking before freeing functions
  2022-06-26  7:44 ` SebinSebastian
  (?)
@ 2022-06-26  7:59 ` Philipp Hortmann
  -1 siblings, 0 replies; 4+ messages in thread
From: Philipp Hortmann @ 2022-06-26  7:59 UTC (permalink / raw)
  To: SebinSebastian
  Cc: skhan, Larry Finger, Phillip Potter, Greg Kroah-Hartman,
	Martin Kaiser, Michael Straube, Pavel Skripkin, linux-staging,
	linux-kernel

On 6/26/22 09:44, SebinSebastian wrote:
> Fix the following coccicheck warning:
> drivers/staging/r8188eu/os_dep/usb_intf.c:376:2-7: WARNING: NULL check before some freeing functions is not needed.
> 
> Signed-off-by: Sebin Sebastian <mailmesebin00@gmail.com>
> ---
>   drivers/staging/r8188eu/os_dep/usb_intf.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
> index 68869c5daeff..f5f1119b5444 100644
> --- a/drivers/staging/r8188eu/os_dep/usb_intf.c
> +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
> @@ -372,8 +372,8 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
>   free_adapter:
>   	if (pnetdev)
>   		rtw_free_netdev(pnetdev);
> -	else if (padapter)
> -		vfree(padapter);
> +	
> +	vfree(padapter);
>   
>   	return NULL;
>   }

Sorry to let you know that this patch was already send in:

Please read the following patches:

https://lore.kernel.org/linux-staging/CAD-N9QUpBHgtu8kssuf-22n94RnLDshioDaJTcFWNipvAuh08g@mail.gmail.com/T/#t

https://lore.kernel.org/linux-staging/20220614133239.147076-1-dzm91@hust.edu.cn/T/#u

Thanks for your support.

Bye Philipp

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

* Re: [PATCH] staging: r8188eu: Remove null checking before freeing functions
  2022-06-26  7:44 ` SebinSebastian
  (?)
  (?)
@ 2022-06-26  8:20 ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2022-06-26  8:20 UTC (permalink / raw)
  To: SebinSebastian
  Cc: skhan, Larry Finger, Phillip Potter, Martin Kaiser,
	Michael Straube, Pavel Skripkin, linux-staging, linux-kernel

On Sun, Jun 26, 2022 at 01:14:11PM +0530, SebinSebastian wrote:
> Fix the following coccicheck warning:
> drivers/staging/r8188eu/os_dep/usb_intf.c:376:2-7: WARNING: NULL check before some freeing functions is not needed.
> 
> Signed-off-by: Sebin Sebastian <mailmesebin00@gmail.com>
> ---
>  drivers/staging/r8188eu/os_dep/usb_intf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
> index 68869c5daeff..f5f1119b5444 100644
> --- a/drivers/staging/r8188eu/os_dep/usb_intf.c
> +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
> @@ -372,8 +372,8 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
>  free_adapter:
>  	if (pnetdev)
>  		rtw_free_netdev(pnetdev);
> -	else if (padapter)
> -		vfree(padapter);
> +	
> +	vfree(padapter);

You introduced another coding style issue, and you changed the logic to
be different here.  Are you sure you want this change to be accepted?

thanks,

greg k-h

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

end of thread, other threads:[~2022-06-26  8:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-26  7:44 [PATCH] staging: r8188eu: Remove null checking before freeing functions SebinSebastian
2022-06-26  7:44 ` SebinSebastian
2022-06-26  7:59 ` Philipp Hortmann
2022-06-26  8:20 ` Greg Kroah-Hartman

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.