[PATCH] driver_nl80211: fix hostapd error path

Jouni Malinen j at w1.fi
Sat Oct 22 06:12:20 EDT 2011


On Fri, Oct 21, 2011 at 04:01:44PM +0200, Johannes Berg wrote:
> i802_init() tries to clean up everything manually,
> call wpa_driver_nl80211_deinit() instead and also
> handle the EAPOL socket properly.

> @@ -6416,6 +6416,8 @@ static void *i802_init(struct hostapd_data *hapd,
> +	drv->eapol_sock = -1;

That looks good..

> @@ -6483,19 +6485,11 @@ static void *i802_init(struct hostapd_data *hapd,
>  	return bss;
>  
>  failed:
> +	if (drv->eapol_sock >= 0) {
> +		eloop_unregister_read_sock(drv->eapol_sock);
> +		close(drv->eapol_sock);
> +	}
> +	wpa_driver_nl80211_deinit(bss);

But the added eapol_sock handling here does not.
wpa_driver_nl80211_deinit() has the exact same code..

Applied with that duplicated code removed.

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list