]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix segfault when params->freq is NULL for AP mode start
authorChaitanya T K <Chaitanya.Mgit@gmail.com>
Thu, 14 Jul 2016 16:50:40 +0000 (22:20 +0530)
committerJouni Malinen <j@w1.fi>
Sat, 23 Jul 2016 19:06:10 +0000 (22:06 +0300)
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 <Chaitanya.Mgit@gmail.com>
src/drivers/driver_nl80211.c

index be32c5da2ed93714483fd3321024c466e2f6f6d2..ae40f427b0d67cdb32800d125b3fb21c9d3496ac 100644 (file)
@@ -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