]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_priv: Handler driver global_deinit() on termination path
authorJouni Malinen <j@w1.fi>
Sat, 3 Dec 2016 15:38:01 +0000 (17:38 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 3 Dec 2016 15:46:08 +0000 (17:46 +0200)
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>
wpa_supplicant/wpa_priv.c

index 11905f32839923199dd74b4f472b41a45c240bbb..6de590a5285ebfab962a8623921bd6125d1fa50f 100644 (file)
@@ -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);