From 01b24c52df57d1714b2520fb9fef21cdb3e1db61 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 17 Nov 2014 00:57:15 +0200 Subject: [PATCH] wired: Fix deinit path to unregister eloop read_sock The previous version was leaving behind registered eloop socket instances. Signed-off-by: Jouni Malinen --- src/drivers/driver_wired.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/drivers/driver_wired.c b/src/drivers/driver_wired.c index 21f5e4248..31ccefe4c 100644 --- a/src/drivers/driver_wired.c +++ b/src/drivers/driver_wired.c @@ -374,11 +374,15 @@ static void wired_driver_hapd_deinit(void *priv) { struct wpa_driver_wired_data *drv = priv; - if (drv->sock >= 0) + if (drv->sock >= 0) { + eloop_unregister_read_sock(drv->sock); close(drv->sock); + } - if (drv->dhcp_sock >= 0) + if (drv->dhcp_sock >= 0) { + eloop_unregister_read_sock(drv->dhcp_sock); close(drv->dhcp_sock); + } os_free(drv); }