Skip to content

Commit

Permalink
wifi: cfg80211: fix locking in sched scan stop work
Browse files Browse the repository at this point in the history
[ Upstream commit 3e54ed8 ]

This should use wiphy_lock() now instead of acquiring the
RTNL, since cfg80211_stop_sched_scan_req() now needs that.

Fixes: a05829a ("cfg80211: avoid holding the RTNL when calling the driver")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jmberg-intel authored and gregkh committed Jun 14, 2023
1 parent f372fe8 commit 1a3ceea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,12 @@ static void cfg80211_sched_scan_stop_wk(struct work_struct *work)
rdev = container_of(work, struct cfg80211_registered_device,
sched_scan_stop_wk);

rtnl_lock();
wiphy_lock(&rdev->wiphy);
list_for_each_entry_safe(req, tmp, &rdev->sched_scan_req_list, list) {
if (req->nl_owner_dead)
cfg80211_stop_sched_scan_req(rdev, req, false);
}
rtnl_unlock();
wiphy_unlock(&rdev->wiphy);
}

static void cfg80211_propagate_radar_detect_wk(struct work_struct *work)
Expand Down

0 comments on commit 1a3ceea

Please sign in to comment.