* [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
* Re: [PATCH v2] staging: rtl8723bs: remove unnecessary NULL check before vfree
2026-05-28 7:00 [PATCH v2] staging: rtl8723bs: remove unnecessary NULL check before vfree Bastien Cossette
@ 2026-05-28 7:03 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-05-28 7:03 UTC (permalink / raw)
To: Bastien Cossette; +Cc: Greg Kroah-Hartman, linux-staging
On Thu, May 28, 2026 at 03:00:45AM -0400, Bastien Cossette wrote:
> 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>
> ---
Please don't resend patches in the same day. Also we need a note
about what changed.
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
regards,
dan carpenter
^ permalink raw reply [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;
as well as URLs for NNTP newsgroup(s).