mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-29 05:39:24 +01:00
station: don't reset/(re)configure/destroy NULL netconfig's
Fixes crashes when `enable_network_config` is false (default).
This commit is contained in:
parent
6672bc2a37
commit
44ae6a46da
@ -1165,11 +1165,13 @@ static void station_enter_state(struct station *station,
|
|||||||
periodic_scan_stop(station);
|
periodic_scan_stop(station);
|
||||||
|
|
||||||
if (station->state == STATION_STATE_ROAMING) {
|
if (station->state == STATION_STATE_ROAMING) {
|
||||||
|
if (station->netconfig)
|
||||||
netconfig_reconfigure(station->netconfig);
|
netconfig_reconfigure(station->netconfig);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (station->netconfig)
|
||||||
netconfig_configure(station->netconfig,
|
netconfig_configure(station->netconfig,
|
||||||
network_get_settings(
|
network_get_settings(
|
||||||
station->connected_network),
|
station->connected_network),
|
||||||
@ -1262,6 +1264,7 @@ static void station_disassociated(struct station *station)
|
|||||||
{
|
{
|
||||||
l_debug("%u", netdev_get_ifindex(station->netdev));
|
l_debug("%u", netdev_get_ifindex(station->netdev));
|
||||||
|
|
||||||
|
if (station->netconfig)
|
||||||
netconfig_reset(station->netconfig);
|
netconfig_reset(station->netconfig);
|
||||||
|
|
||||||
station_reset_connection_state(station);
|
station_reset_connection_state(station);
|
||||||
@ -2344,6 +2347,7 @@ static void station_disconnect_onconnect(struct station *station,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (station->netconfig)
|
||||||
netconfig_reset(station->netconfig);
|
netconfig_reset(station->netconfig);
|
||||||
|
|
||||||
station_reset_connection_state(station);
|
station_reset_connection_state(station);
|
||||||
@ -2581,6 +2585,7 @@ int station_disconnect(struct station *station)
|
|||||||
station_disconnect_cb, station) < 0)
|
station_disconnect_cb, station) < 0)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
|
if (station->netconfig)
|
||||||
netconfig_reset(station->netconfig);
|
netconfig_reset(station->netconfig);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3061,6 +3066,7 @@ static void station_free(struct station *station)
|
|||||||
if (station->connected_bss)
|
if (station->connected_bss)
|
||||||
netdev_disconnect(station->netdev, NULL, NULL);
|
netdev_disconnect(station->netdev, NULL, NULL);
|
||||||
|
|
||||||
|
if (station->netconfig)
|
||||||
netconfig_destroy(station->netconfig);
|
netconfig_destroy(station->netconfig);
|
||||||
station->netconfig = NULL;
|
station->netconfig = NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user