Commit 01ca280d authored by Johannes Berg's avatar Johannes Berg

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: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1474bc87
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Copied from cfg.c - originally * Copied from cfg.c - originally
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2014 Intel Corporation (Author: Johannes Berg) * 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 <linux/types.h>
#include <net/cfg80211.h> #include <net/cfg80211.h>
...@@ -102,6 +102,7 @@ static void ieee80211_get_stats(struct net_device *dev, ...@@ -102,6 +102,7 @@ static void ieee80211_get_stats(struct net_device *dev,
* network device. * network device.
*/ */
wiphy_lock(local->hw.wiphy);
mutex_lock(&local->sta_mtx); mutex_lock(&local->sta_mtx);
if (sdata->vif.type == NL80211_IFTYPE_STATION) { if (sdata->vif.type == NL80211_IFTYPE_STATION) {
...@@ -200,10 +201,13 @@ static void ieee80211_get_stats(struct net_device *dev, ...@@ -200,10 +201,13 @@ static void ieee80211_get_stats(struct net_device *dev,
mutex_unlock(&local->sta_mtx); 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; return;
}
drv_get_et_stats(sdata, stats, &(data[STA_STATS_LEN])); 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) static void ieee80211_get_strings(struct net_device *dev, u32 sset, u8 *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment