From 1efbe1637fbc62e147759c3a637c8eb85cb7bcd8 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 26 Jul 2022 10:09:11 -0700 Subject: [PATCH] manager: unregister nl80211 config watch For consistency unregister the config watch when manager exits --- src/manager.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/manager.c b/src/manager.c index ca29e110..437841b3 100644 --- a/src/manager.c +++ b/src/manager.c @@ -49,6 +49,7 @@ static char **whitelist_filter; static char **blacklist_filter; static bool randomize; static bool use_default; +static unsigned int config_watch; struct wiphy_setup_state { uint32_t id; @@ -820,8 +821,10 @@ static int manager_init(void) pending_wiphys = l_queue_new(); - if (!l_genl_family_register(nl80211, "config", manager_config_notify, - NULL, NULL)) { + config_watch = l_genl_family_register(nl80211, "config", + manager_config_notify, + NULL, NULL); + if (!config_watch) { l_error("Registering for config notifications failed"); goto error; } @@ -880,6 +883,8 @@ static void manager_exit(void) l_strfreev(whitelist_filter); l_strfreev(blacklist_filter); + l_genl_family_unregister(nl80211, config_watch); + l_queue_destroy(pending_wiphys, wiphy_setup_state_free); pending_wiphys = NULL;