Skip to content
/ linux Public

Commit 677490a

Browse files
Ethan TidmoreSasha Levin
authored andcommitted
staging: rtl8723bs: fix null dereference in find_network
[ Upstream commit 41460a1 ] The variable pwlan has the possibility of being NULL when passed into rtw_free_network_nolock() which would later dereference the variable. Fixes: 554c0a3 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 7e4d88e commit 677490a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/staging/rtl8723bs/core/rtw_mlme.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,8 +835,10 @@ static void find_network(struct adapter *adapter)
835835
struct wlan_network *tgt_network = &pmlmepriv->cur_network;
836836

837837
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.mac_address);
838-
if (pwlan)
839-
pwlan->fixed = false;
838+
if (!pwlan)
839+
return;
840+
841+
pwlan->fixed = false;
840842

841843
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) &&
842844
(adapter->stapriv.asoc_sta_count == 1))

0 commit comments

Comments
 (0)