Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH v3] staging: rtl8723bs: remove unnecessary NULL check before vfree
@ 2026-05-28  7:05 Bastien Cossette
  2026-05-28  7:25 ` Dan Carpenter
  2026-05-28  7:28 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 3+ messages in thread
From: Bastien Cossette @ 2026-05-28  7:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Dan Carpenter, linux-staging, Bastien Cossette

The vfree() function handles NULL pointers natively. Cleaning up the
redundant if check simplifies the code and adheres to core kernel
coding styles.

Signed-off-by: Bastien Cossette <bastiencossette29@icloud.com>
---
 drivers/staging/rtl8723bs/hal/hal_com.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 728a2171fbcb..00c511b38595 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -23,14 +23,11 @@ u8 rtw_hal_data_init(struct adapter *padapter)
 
 void rtw_hal_data_deinit(struct adapter *padapter)
 {
-	if (padapter->HalData) {
-		vfree(padapter->HalData);
-		padapter->HalData = NULL;
-		padapter->hal_data_sz = 0;
-	}
+	vfree(padapter->HalData);
+	padapter->HalData = NULL;
+	padapter->hal_data_sz = 0;
 }
 
-
 void dump_chip_info(struct hal_version	chip_version)
 {
 	char buf[128];
-- 
2.53.0


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

end of thread, other threads:[~2026-05-28  7:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28  7:05 [PATCH v3] staging: rtl8723bs: remove unnecessary NULL check before vfree Bastien Cossette
2026-05-28  7:25 ` Dan Carpenter
2026-05-28  7:28 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox