]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: rtl8723bs: remove redundant NULL check on premainder_ie
authorGiorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Sat, 21 Feb 2026 12:47:33 +0000 (16:47 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Feb 2026 14:45:06 +0000 (15:45 +0100)
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>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260221124732.327156-2-giorgitchankvetadze1997@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_ap.c

index 29c476f0e8024dbccc49aca3ddbb6ecde7ed18f8..4ad10ac5d2bf7b5e2b9c86b36a54659f7c8ba87f 100644 (file)
@@ -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 */