3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

device: Fix crashes when outside of Station mode

This commit is contained in:
Denis Kenzior 2018-09-10 20:01:35 -05:00
parent 0a42f63d42
commit 95896c10ff

View File

@ -149,7 +149,7 @@ static bool device_property_get_connected_network(struct l_dbus *dbus,
struct device *device = user_data;
struct station *station = device->station;
if (!station->connected_network)
if (!station || !station->connected_network)
return false;
l_dbus_message_builder_append_basic(builder, 'o',
@ -306,7 +306,12 @@ static bool device_property_get_scanning(struct l_dbus *dbus,
{
struct device *device = user_data;
struct station *station = device->station;
bool scanning = station->scanning;
bool scanning;
if (!station)
return false;
scanning = station->scanning;
l_dbus_message_builder_append_basic(builder, 'b', &scanning);