* [PATCH v2] staging: rtl8723bs: remove unnecessary NULL check before vfree
@ 2026-05-28 7:00 Bastien Cossette
2026-05-28 7:03 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Bastien Cossette @ 2026-05-28 7:00 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: 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] 2+ messages in thread
end of thread, other threads:[~2026-05-28 7:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28 7:00 [PATCH v2] staging: rtl8723bs: remove unnecessary NULL check before vfree Bastien Cossette
2026-05-28 7:03 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox