Avoid crash after driver init failure
authorJouni Malinen <j@w1.fi>
Sun, 7 Mar 2010 09:25:28 +0000 (11:25 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 7 Mar 2010 09:25:28 +0000 (11:25 +0200)
hostapd_flush_old_stations() needs to check whether the driver
initialization was successful since it gets called on an error path.

src/ap/hostapd.c

index 8bf92b8..2c0c87d 100644 (file)
@@ -299,7 +299,7 @@ static int hostapd_flush_old_stations(struct hostapd_data *hapd)
 {
        int ret = 0;
 
-       if (hostapd_drv_none(hapd))
+       if (hostapd_drv_none(hapd) || hapd->drv_priv == NULL)
                return 0;
 
        wpa_printf(MSG_DEBUG, "Flushing old station entries");