diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 741e6c7edcb7..6842c3011a99 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -1353,6 +1353,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_MONITOR); hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_MONITOR); + if (!channels) + return -EINVAL; local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) + sizeof(void *) * channels, GFP_KERNEL);