]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Fix crash on consecutive channel switch failures
authorMohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Wed, 22 Mar 2017 11:42:38 +0000 (17:12 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 29 Mar 2017 12:03:16 +0000 (15:03 +0300)
With multiple interface like AP and station which is already
associated to some other AP, when we try to do channel switch
for the AP mode (different from the operation channel support of
station) and if the AP channel switch fails continously (including
the fallback channel switch), results in a crash due to NULL pointer
dereference. This is because hostapd_deinit_driver() assigns the
driver context (drv_priv) to NULL as we are not able to bring up
the interface with a new channel

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
src/ap/ap_drv_ops.h

index 0bb7954ec061f203c5fbe83a6a9f0d12300dd3c2..aa82eb3a711687db4bdff94347df588c42b3a8f0 100644 (file)
@@ -274,7 +274,8 @@ static inline const char * hostapd_drv_get_radio_name(struct hostapd_data *hapd)
 static inline int hostapd_drv_switch_channel(struct hostapd_data *hapd,
                                             struct csa_settings *settings)
 {
-       if (hapd->driver == NULL || hapd->driver->switch_channel == NULL)
+       if (hapd->driver == NULL || hapd->driver->switch_channel == NULL ||
+           hapd->drv_priv == NULL)
                return -ENOTSUP;
 
        return hapd->driver->switch_channel(hapd->drv_priv, settings);