Преглед на файлове

cfg80211: fix crash in cfg80211_set_freq()

Since wdev can be NULL, check it before dereferencing it

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau преди 15 години
родител
ревизия
9fbc630c89
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      net/wireless/chan.c

+ 1 - 1
net/wireless/chan.c

@@ -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) {