3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-10-04 02:18:49 +02:00

station: Don't call network_rank_update with NULL network

Move the update of station->networks_sorted order to before we set
station->connected_network NULL to avoid a crash when we attempt to
use the NULL pointer.
This commit is contained in:
Andrew Zaborowski 2020-08-17 12:06:38 +02:00 committed by Denis Kenzior
parent bfd8cead95
commit 49f38b0d2e

View File

@ -1298,15 +1298,15 @@ static void station_reset_connection_state(struct station *station)
station_roam_state_clear(station);
station->connected_bss = NULL;
station->connected_network = NULL;
/* Refresh the ordered network list */
network_rank_update(station->connected_network, false);
l_queue_remove(station->networks_sorted, station->connected_network);
l_queue_insert(station->networks_sorted, station->connected_network,
network_rank_compare, NULL);
station->connected_bss = NULL;
station->connected_network = NULL;
l_dbus_property_changed(dbus, netdev_get_path(station->netdev),
IWD_STATION_INTERFACE, "ConnectedNetwork");
l_dbus_property_changed(dbus, network_get_path(network),