* [PATCH] staging: rtl8723bs: remove redundant NULL check on premainder_ie
@ 2026-02-21 12:47 Giorgi Tchankvetadze
2026-02-21 18:44 ` Ethan Tidmore
0 siblings, 1 reply; 2+ messages in thread
From: Giorgi Tchankvetadze @ 2026-02-21 12:47 UTC (permalink / raw)
To: gregkh, linux-staging; +Cc: linux-kernel, Giorgi Tchankvetadze
premainder_ie is computed as pwps_ie + wps_ielen, where pwps_ie is
already validated non-NULL earlier in the function. Pointer arithmetic
on a non-NULL pointer can never yield NULL, making this check always
true and misleading. Replace with a simple check on remainder_ielen.
Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_ap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
index ebe73abab892..2b28c5fd436b 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -1439,7 +1439,7 @@ static void update_bcn_wps_ie(struct adapter *padapter)
remainder_ielen = ielen - wps_offset - wps_ielen;
- if (premainder_ie && remainder_ielen)
+ if (remainder_ielen)
pbackup_remainder_ie = kmemdup(premainder_ie, remainder_ielen, GFP_ATOMIC);
wps_ielen = (uint)pwps_ie_src[1];/* to get ie data len */
--
2.52.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: rtl8723bs: remove redundant NULL check on premainder_ie
2026-02-21 12:47 [PATCH] staging: rtl8723bs: remove redundant NULL check on premainder_ie Giorgi Tchankvetadze
@ 2026-02-21 18:44 ` Ethan Tidmore
0 siblings, 0 replies; 2+ messages in thread
From: Ethan Tidmore @ 2026-02-21 18:44 UTC (permalink / raw)
To: Giorgi Tchankvetadze, gregkh, linux-staging; +Cc: linux-kernel
On Sat Feb 21, 2026 at 6:47 AM CST, Giorgi Tchankvetadze wrote:
> premainder_ie is computed as pwps_ie + wps_ielen, where pwps_ie is
> already validated non-NULL earlier in the function. Pointer arithmetic
> on a non-NULL pointer can never yield NULL, making this check always
> true and misleading. Replace with a simple check on remainder_ielen.
>
> Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
> ---
LGTM.
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Thanks,
ET
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-21 18:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-21 12:47 [PATCH] staging: rtl8723bs: remove redundant NULL check on premainder_ie Giorgi Tchankvetadze
2026-02-21 18:44 ` Ethan Tidmore
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®