All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: <kvalo@kernel.org>
Cc: <gary.chang@realtek.com>, <phhuang@realtek.com>,
	<linux-wireless@vger.kernel.org>
Subject: [PATCH 5/8] wifi: rtw89: fix null pointer access when abort scan
Date: Fri, 19 Jan 2024 16:14:58 +0800	[thread overview]
Message-ID: <20240119081501.25223-6-pkshih@realtek.com> (raw)
In-Reply-To: <20240119081501.25223-1-pkshih@realtek.com>

From: Po-Hao Huang <phhuang@realtek.com>

During cancel scan we might use vif that weren't scanning.
Fix this by using the actual scanning vif.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/mac80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/mac80211.c b/drivers/net/wireless/realtek/rtw89/mac80211.c
index 21b42984fd8a..b61c5be8cae3 100644
--- a/drivers/net/wireless/realtek/rtw89/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw89/mac80211.c
@@ -441,7 +441,7 @@ static void rtw89_ops_bss_info_changed(struct ieee80211_hw *hw,
 			 * when disconnected by peer
 			 */
 			if (rtwdev->scanning)
-				rtw89_hw_scan_abort(rtwdev, vif);
+				rtw89_hw_scan_abort(rtwdev, rtwdev->scan_info.scanning_vif);
 		}
 	}
 
@@ -994,7 +994,7 @@ static int rtw89_ops_remain_on_channel(struct ieee80211_hw *hw,
 	}
 
 	if (rtwdev->scanning)
-		rtw89_hw_scan_abort(rtwdev, vif);
+		rtw89_hw_scan_abort(rtwdev, rtwdev->scan_info.scanning_vif);
 
 	if (type == IEEE80211_ROC_TYPE_MGMT_TX)
 		roc->state = RTW89_ROC_MGMT;
-- 
2.25.1


  parent reply	other threads:[~2024-01-19  8:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-19  8:14 [PATCH 0/8] wifi: rtw89: refine hardware scan and concurrent Ping-Ke Shih
2024-01-19  8:14 ` [PATCH 1/8] wifi: rtw89: refine add_chan H2C command to encode_bits Ping-Ke Shih
2024-01-23 11:38   ` Kalle Valo
2024-01-19  8:14 ` [PATCH 2/8] wifi: rtw89: refine hardware scan C2H events Ping-Ke Shih
2024-01-19  8:14 ` [PATCH 3/8] wifi: rtw89: Set default CQM config if not present Ping-Ke Shih
2024-01-19  8:14 ` [PATCH 4/8] wifi: rtw89: disable RTS when broadcast/multicast Ping-Ke Shih
2024-01-19  8:14 ` Ping-Ke Shih [this message]
2024-01-19  8:14 ` [PATCH 6/8] wifi: rtw89: add wait/completion for abort scan Ping-Ke Shih
2024-01-19  8:15 ` [PATCH 7/8] wifi: rtw89: fix HW scan timeout due to TSF sync issue Ping-Ke Shih
2024-01-19  8:15 ` [PATCH 8/8] wifi: rtw89: fix disabling concurrent mode TX hang issue Ping-Ke Shih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240119081501.25223-6-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=gary.chang@realtek.com \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=phhuang@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.