]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: rtl8723bs: fix null dereference in find_network
authorEthan Tidmore <ethantidmore06@gmail.com>
Mon, 2 Feb 2026 20:54:29 +0000 (14:54 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Feb 2026 13:22:04 +0000 (14:22 +0100)
The variable pwlan has the possibility of being NULL when passed into
rtw_free_network_nolock() which would later dereference the variable.

Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable@vger.kernel.org
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260202205429.20181-1-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_mlme.c

index b3a9e40054a7f9e89ced806dbc351cf7544e5fe9..8e98344951acf936917dc15c3b9dec1fdb5396bf 100644 (file)
@@ -826,8 +826,10 @@ static void find_network(struct adapter *adapter)
        struct wlan_network *tgt_network = &pmlmepriv->cur_network;
 
        pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.mac_address);
-       if (pwlan)
-               pwlan->fixed = false;
+       if (!pwlan)
+               return;
+
+       pwlan->fixed = false;
 
        if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) &&
            (adapter->stapriv.asoc_sta_count == 1))