[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220614090340.123714-1-dzm91@hust.edu.cn>
Date: Tue, 14 Jun 2022 17:03:30 +0800
From: Dongliang Mu <dzm91@...t.edu.cn>
To: Larry Finger <Larry.Finger@...inger.net>,
Phillip Potter <phil@...lpotter.co.uk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Martin Kaiser <martin@...ser.cx>,
Michael Straube <straube.linux@...il.com>,
Pavel Skripkin <paskripkin@...il.com>
Cc: mudongliang <mudongliangabcd@...il.com>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH] driver: r8188eu: remove NULL check before vfree
From: mudongliang <mudongliangabcd@...il.com>
vfree can handle NULL pointer as its argument.
According to coccinelle isnullfree check, remove NULL check
before vfree operation.
Signed-off-by: mudongliang <mudongliangabcd@...il.com>
---
drivers/staging/r8188eu/os_dep/usb_intf.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 68869c5daeff..bd1c8b4b5c4b 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -372,8 +372,7 @@ 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.35.1
Powered by blists - more mailing lists