lkml.org 
[lkml]   [2021]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] staging: r8188eu: Remove unneeded if-null-free check
Date
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
\
 
 \ /
  Last update: 2021-09-18 11:11    [W:0.041 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site