Skip to contentSkip to conversation

cfg80211: fix crash in cfg80211_set_freq()

PATCH New Felix Fietkau 1 participant 1 message May 15, 2010 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfg80211: fix crash in cfg80211_set_freq()

Since wdev can be NULL, check it before dereferencing it

---
 net/wireless/chan.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/wireless/chan.c +1 -1
index d92d088..b01a6f6 100644
@@ -50,7 +50,7 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
 	struct ieee80211_channel *chan;
 	int result;
 
-	if (wdev->iftype == NL80211_IFTYPE_MONITOR)
+	if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR)
 		wdev = NULL;
 
 	if (wdev) {
Signature · 1 line
1.6.4.2