hostapd: Fix WPA, IEEE 802.1X, and WPS deinit in cases where init fails

With driver wrappers that implement set_privacy(), set_generic_elem(),
set_ieee8021x(), or set_ap_wps_ie(), it was possible to hit a NULL
pointer dereference in error cases where interface setup failed and
the network configuration used WPA/WPA2, IEEE 802.1X, or WPS.

Fix this by skipping the driver operations in case the driver interface
is not initialized.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-10-13 23:35:00 +03:00 committed by Jouni Malinen
parent 4150c7c97c
commit 1b822f52e6
3 changed files with 6 additions and 4 deletions

View file

@ -872,7 +872,8 @@ static void hostapd_wps_clear_ies(struct hostapd_data *hapd, int deinit_only)
hapd->wps_probe_resp_ie = NULL;
if (deinit_only) {
hostapd_reset_ap_wps_ie(hapd);
if (hapd->drv_priv)
hostapd_reset_ap_wps_ie(hapd);
return;
}