3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-21 11:52:34 +01:00

device: Make sure connected network is not freed

During the network_info refactoring the adding of the connected BSS to
device->bss_list in case it is not in the scan results has moved to
after the l_hashmap_foreach_remove call meaning that the network could
be removed even though it is still pointed at by
device->connected networks.  Reverse the order to what it was before.

Alternatively network_process network could take not of the fact the
network is connected and not call network_remove on it leaving it with
an empty bss_list.
This commit is contained in:
Andrew Zaborowski 2016-06-24 05:09:05 +02:00 committed by Denis Kenzior
parent 8f0d68139e
commit c508d9e4df

View File

@ -400,8 +400,6 @@ static bool new_scan_results(uint32_t wiphy_id, uint32_t ifindex,
process_bss(device, bss, &now); process_bss(device, bss, &now);
} }
l_hashmap_foreach_remove(device->networks, process_network, device);
if (device->connected_bss) { if (device->connected_bss) {
struct scan_bss *bss; struct scan_bss *bss;
@ -420,6 +418,8 @@ static bool new_scan_results(uint32_t wiphy_id, uint32_t ifindex,
device->connected_bss = bss; device->connected_bss = bss;
} }
l_hashmap_foreach_remove(device->networks, process_network, device);
l_queue_destroy(device->old_bss_list, bss_free); l_queue_destroy(device->old_bss_list, bss_free);
device->old_bss_list = NULL; device->old_bss_list = NULL;