Skip to content

Commit

Permalink
mac80211: fix locking in ieee80211_restart_work()
Browse files Browse the repository at this point in the history
[ Upstream commit 276e189 ]

Ilan's change to move locking around accidentally lost the
wiphy_lock() during some porting, add it back.

Fixes: 45daaa1 ("mac80211: Properly WARN on HW scan before restart")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20210817121210.47bdb177064f.Ib1ef79440cd27f318c028ddfc0c642406917f512@changeid
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jmberg-intel authored and Sasha Levin committed Aug 26, 2021
1 parent 0de9c4d commit 39af358
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/mac80211/main.c
Expand Up @@ -260,6 +260,8 @@ static void ieee80211_restart_work(struct work_struct *work)
flush_work(&local->radar_detected_work);

rtnl_lock();
/* we might do interface manipulations, so need both */
wiphy_lock(local->hw.wiphy);

WARN(test_bit(SCAN_HW_SCANNING, &local->scanning),
"%s called with hardware scan in progress\n", __func__);
Expand Down

0 comments on commit 39af358

Please sign in to comment.