3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 02:19:26 +01:00

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

View File

@ -49,6 +49,7 @@ static char **whitelist_filter;
static char **blacklist_filter; static char **blacklist_filter;
static bool randomize; static bool randomize;
static bool use_default; static bool use_default;
static unsigned int config_watch;
struct wiphy_setup_state { struct wiphy_setup_state {
uint32_t id; uint32_t id;
@ -820,8 +821,10 @@ static int manager_init(void)
pending_wiphys = l_queue_new(); pending_wiphys = l_queue_new();
if (!l_genl_family_register(nl80211, "config", manager_config_notify, config_watch = l_genl_family_register(nl80211, "config",
NULL, NULL)) { manager_config_notify,
NULL, NULL);
if (!config_watch) {
l_error("Registering for config notifications failed"); l_error("Registering for config notifications failed");
goto error; goto error;
} }
@ -880,6 +883,8 @@ static void manager_exit(void)
l_strfreev(whitelist_filter); l_strfreev(whitelist_filter);
l_strfreev(blacklist_filter); l_strfreev(blacklist_filter);
l_genl_family_unregister(nl80211, config_watch);
l_queue_destroy(pending_wiphys, wiphy_setup_state_free); l_queue_destroy(pending_wiphys, wiphy_setup_state_free);
pending_wiphys = NULL; pending_wiphys = NULL;