aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-12-03 15:38:01 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-03 15:46:08 (GMT)
commit6d97561dcda1756f081817e541cc2712d8dbf03c (patch)
treed266a94d96c72cc0a2ee8bf5abd79b78a45ed47d /wpa_supplicant
parentce0f899a3d9bdf6ed26e92ebfd14c623db033ae3 (diff)
downloadhostap-6d97561dcda1756f081817e541cc2712d8dbf03c.zip
hostap-6d97561dcda1756f081817e541cc2712d8dbf03c.tar.gz
hostap-6d97561dcda1756f081817e541cc2712d8dbf03c.tar.bz2
wpa_priv: Handler driver global_deinit() on termination path
This avoids a theoretical resource leak on exit path if wpa_priv is killed while there is a wpa_supplicant process using it. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/wpa_priv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c
index 11905f3..6de590a 100644
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
@@ -685,8 +685,12 @@ static void wpa_priv_interface_deinit(struct wpa_priv_interface *iface)
{
int i;
- if (iface->drv_priv && iface->driver->deinit)
- iface->driver->deinit(iface->drv_priv);
+ if (iface->drv_priv) {
+ if (iface->driver->deinit)
+ iface->driver->deinit(iface->drv_priv);
+ if (iface->drv_global_priv)
+ iface->driver->global_deinit(iface->drv_global_priv);
+ }
if (iface->fd >= 0) {
eloop_unregister_read_sock(iface->fd);