Skip to contentSkip to conversation

staging: r8188eu: Remove null checking before freeing functions

PATCH In review SebinSebastian 3 participants 3 messages Jun 26, 2022 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: r8188eu: Remove null checking before freeing functions

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.

---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/os_dep/usb_intf.c +2 -2
index 68869c5daeff..f5f1119b5444 100644
@@ -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;
 }
Signature · 1 line
2.34.1
#1 lore raw
Quoted 13 lines · SebinSebastian

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.

---
  drivers/staging/r8188eu/os_dep/usb_intf.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/os_dep/usb_intf.c +0 -0
index 68869c5daeff..f5f1119b5444 100644

drivers/staging/r8188eu/os_dep/usb_intf.c static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, · line 379

Quoted 10 lines
drivers/staging/r8188eu/os_dep/usb_intf.c +2 -2
@@ -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/[email protected]/T/#u

Thanks for your support.

Bye Philipp

#2 lore raw
In reply to SebinSebastian
Quoted 13 lines · SebinSebastian

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.

---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/os_dep/usb_intf.c +0 -0
index 68869c5daeff..f5f1119b5444 100644

drivers/staging/r8188eu/os_dep/usb_intf.c static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, · line 376

Quoted 7 lines
drivers/staging/r8188eu/os_dep/usb_intf.c +2 -2
@@ -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