manager: unregister nl80211 config watch

For consistency unregister the config watch when manager exits
This commit is contained in:
James Prestwood 2022-07-26 10:09:11 -07:00 committed by Denis Kenzior
parent 4353935e0a
commit 1efbe1637f
1 changed files with 7 additions and 2 deletions

View File

@ -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;