From: Chaitanya T K Date: Thu, 14 Jul 2016 16:50:40 +0000 (+0530) Subject: nl80211: Fix segfault when params->freq is NULL for AP mode start X-Git-Tag: hostap_2_6~182 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5728d0a82d5c5fb5347e41ce761fdf4a79772ec;p=thirdparty%2Fhostap.git nl80211: Fix segfault when params->freq is NULL for AP mode start If params->freq is NULL here, it leads to a segfault. Do not initialize bss->bandwidth if params->freq is NULL. Signed-off-by: Chaitanya T K --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index be32c5da2..ae40f427b 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -3706,7 +3706,7 @@ static int wpa_driver_nl80211_set_ap(void *priv, "nl80211: Frequency set succeeded for ht2040 coex"); bss->bandwidth = params->freq->bandwidth; } - } else if (!beacon_set) { + } else if (!beacon_set && params->freq) { /* * cfg80211 updates the driver on frequence change in AP * mode only at the point when beaconing is started, so