diff options
author | Johannes Berg <johannes.berg@intel.com> | 2023-08-28 14:59:57 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-09-11 12:27:21 +0300 |
commit | 01ca280d323ef4a7e6732615b1faaa8877cc417f (patch) | |
tree | f660a3e3b7eed9b1fed69911e55374a20237eda0 | |
parent | 1474bc87fe57deac726cc10203f73daa6c3212f7 (diff) | |
download | linux-01ca280d323ef4a7e6732615b1faaa8877cc417f.tar.xz |
wifi: mac80211: ethtool: hold wiphy mutex
We should hold the wiphy mutex here since we're going
to call the driver and want to remove the sta_mtx.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/ethtool.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/mac80211/ethtool.c b/net/mac80211/ethtool.c index a3830d925cc2..c53208321c8f 100644 --- a/net/mac80211/ethtool.c +++ b/net/mac80211/ethtool.c @@ -5,7 +5,7 @@ * Copied from cfg.c - originally * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> * Copyright 2014 Intel Corporation (Author: Johannes Berg) - * Copyright (C) 2018, 2022 Intel Corporation + * Copyright (C) 2018, 2022-2023 Intel Corporation */ #include <linux/types.h> #include <net/cfg80211.h> @@ -102,6 +102,7 @@ static void ieee80211_get_stats(struct net_device *dev, * network device. */ + wiphy_lock(local->hw.wiphy); mutex_lock(&local->sta_mtx); if (sdata->vif.type == NL80211_IFTYPE_STATION) { @@ -200,10 +201,13 @@ do_survey: mutex_unlock(&local->sta_mtx); - if (WARN_ON(i != STA_STATS_LEN)) + if (WARN_ON(i != STA_STATS_LEN)) { + wiphy_unlock(local->hw.wiphy); return; + } drv_get_et_stats(sdata, stats, &(data[STA_STATS_LEN])); + wiphy_unlock(local->hw.wiphy); } static void ieee80211_get_strings(struct net_device *dev, u32 sset, u8 *data) |