mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
wext: call cfg80211_set_encryption() with wiphy lock held
Similar to the previous commit, we need to hold the wiphy lock
here. There's a second instance that is correct already, fix
this one as well.
Fixes: a05829a722
("cfg80211: avoid holding the RTNL when calling the driver")
Link: https://lore.kernel.org/r/20210128183454.ea2f086465ed.I891d3bb44f068e6d97c160005010f052f28ab6e5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
@@ -655,6 +655,7 @@ static int cfg80211_wext_siwencodeext(struct net_device *dev,
|
|||||||
bool remove = false;
|
bool remove = false;
|
||||||
struct key_params params;
|
struct key_params params;
|
||||||
u32 cipher;
|
u32 cipher;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (wdev->iftype != NL80211_IFTYPE_STATION &&
|
if (wdev->iftype != NL80211_IFTYPE_STATION &&
|
||||||
wdev->iftype != NL80211_IFTYPE_ADHOC)
|
wdev->iftype != NL80211_IFTYPE_ADHOC)
|
||||||
@@ -726,12 +727,16 @@ static int cfg80211_wext_siwencodeext(struct net_device *dev,
|
|||||||
params.seq_len = 6;
|
params.seq_len = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cfg80211_set_encryption(
|
wiphy_lock(wdev->wiphy);
|
||||||
|
ret = cfg80211_set_encryption(
|
||||||
rdev, dev,
|
rdev, dev,
|
||||||
!(ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY),
|
!(ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY),
|
||||||
addr, remove,
|
addr, remove,
|
||||||
ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY,
|
ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY,
|
||||||
idx, ¶ms);
|
idx, ¶ms);
|
||||||
|
wiphy_unlock(wdev->wiphy);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cfg80211_wext_giwencode(struct net_device *dev,
|
static int cfg80211_wext_giwencode(struct net_device *dev,
|
||||||
|
Reference in New Issue
Block a user