From: Johannes Berg Date: Sat, 22 Oct 2011 10:04:47 +0000 (+0300) Subject: nl80211: Fix hostapd error path X-Git-Tag: hostap-1-bp~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7635bfb071ce68b6d56f6d6be18964e44ca88a56;p=thirdparty%2Fhostap.git nl80211: Fix hostapd error path i802_init() tries to clean up everything manually, call wpa_driver_nl80211_deinit() instead and also handle the EAPOL socket properly. --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 1289fcc74..2ecd0bd02 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -6395,6 +6395,8 @@ static void *i802_init(struct hostapd_data *hapd, drv = bss->drv; drv->nlmode = NL80211_IFTYPE_AP; + drv->eapol_sock = -1; + if (linux_br_get(brname, params->ifname) == 0) { wpa_printf(MSG_DEBUG, "nl80211: Interface %s is in bridge %s", params->ifname, brname); @@ -6462,18 +6464,7 @@ static void *i802_init(struct hostapd_data *hapd, return bss; failed: - nl80211_remove_monitor_interface(drv); - rfkill_deinit(drv->rfkill); - if (drv->ioctl_sock >= 0) - close(drv->ioctl_sock); - - genl_family_put(drv->nl80211); - nl_cache_free(drv->nl_cache); - nl80211_handle_destroy(drv->nl_handle); - nl_cb_put(drv->nl_cb); - eloop_unregister_read_sock(nl_socket_get_fd(drv->nl_handle_event)); - - os_free(drv); + wpa_driver_nl80211_deinit(bss); return NULL; }