Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85f72bc8 authored by John W. Linville's avatar John W. Linville
Browse files

mac80211: only cancel software-based scans on suspend



Otherwise the hardware scan handler could access an invalid scan request
structure.  The driver should cancel any pending hardware scans during
the suspend process anyway, so also add a warning if the hardware scan
is still pending when the device resumes.

Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 18145c69
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -1186,6 +1186,12 @@ int __ieee80211_suspend(struct ieee80211_hw *hw);


static inline int __ieee80211_resume(struct ieee80211_hw *hw)
static inline int __ieee80211_resume(struct ieee80211_hw *hw)
{
{
	struct ieee80211_local *local = hw_to_local(hw);

	WARN(test_bit(SCAN_HW_SCANNING, &local->scanning),
		"%s: resume with hardware scan still in progress\n",
		wiphy_name(hw->wiphy));

	return ieee80211_reconfig(hw_to_local(hw));
	return ieee80211_reconfig(hw_to_local(hw));
}
}
#else
#else
+2 −1
Original line number Original line Diff line number Diff line
@@ -12,6 +12,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
	struct ieee80211_sub_if_data *sdata;
	struct ieee80211_sub_if_data *sdata;
	struct sta_info *sta;
	struct sta_info *sta;


	if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning)))
		ieee80211_scan_cancel(local);
		ieee80211_scan_cancel(local);


	ieee80211_stop_queues_by_reason(hw,
	ieee80211_stop_queues_by_reason(hw,