mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
netdev: Do not leak netdev objects
If the daemon is started and killed rapidly on startup, it is possible for netdev_shutdown to be called prior to manager processing messages that actually create the netdev itself. Since the netdev_list has already been freed, the storage is lost. Fix that by destroying netdev_list only when the module is unloaded.
This commit is contained in:
parent
2b0b5d4173
commit
d773c0b4ac
@ -5959,6 +5959,7 @@ static void netdev_exit(void)
|
||||
|
||||
watchlist_destroy(&netdev_watches);
|
||||
l_queue_destroy(netdev_list, netdev_free);
|
||||
netdev_list = NULL;
|
||||
|
||||
l_genl_family_free(nl80211);
|
||||
nl80211 = NULL;
|
||||
@ -5979,9 +5980,6 @@ void netdev_shutdown(void)
|
||||
netdev_free(netdev);
|
||||
l_queue_pop_head(netdev_list);
|
||||
}
|
||||
|
||||
l_queue_destroy(netdev_list, NULL);
|
||||
netdev_list = NULL;
|
||||
}
|
||||
|
||||
IWD_MODULE(netdev, netdev_init, netdev_exit);
|
||||
|
Loading…
Reference in New Issue
Block a user