From f5728d0a82d5c5fb5347e41ce761fdf4a79772ec Mon Sep 17 00:00:00 2001 From: Chaitanya T K Date: Thu, 14 Jul 2016 22:20:40 +0530 Subject: [PATCH] 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 --- src/drivers/driver_nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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