summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-09-05 13:51:30 +0200
committerLubomir Rintel <lkundrak@v3.sk>2019-09-07 17:22:00 +0200
commitad86ee4d480b3f83b12fed149d0c141a9d6f318c (patch)
treeb4e626ec93e90107cc2c66c9259c97ac55297632
parentcc96771f32f55c57f56c7e70f937d9837411c44d (diff)
downloadNetworkManager-ad86ee4d480b3f83b12fed149d0c141a9d6f318c.tar.gz
wifi/olpc-mesh: drop assert(companion) from get_autoconnect_allowed()
The comment is wrong. Since 6eaded9071fb ('device: add get_autoconnect_allowed() virtual function'), get_autoconnect_allowed() is called before the device state is consulted.
-rw-r--r--src/devices/wifi/nm-device-olpc-mesh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/devices/wifi/nm-device-olpc-mesh.c b/src/devices/wifi/nm-device-olpc-mesh.c
index 3551a9e486..752e5ccbba 100644
--- a/src/devices/wifi/nm-device-olpc-mesh.c
+++ b/src/devices/wifi/nm-device-olpc-mesh.c
@@ -82,9 +82,9 @@ get_autoconnect_allowed (NMDevice *device)
NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (device);
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self);
- /* We shall always have a companion if we're >= DISCONENCTED, and this
- * ought not be called until then. */
- g_return_val_if_fail (priv->companion, FALSE);
+ /* We can't even connect if we don't have a companion yet. */
+ if (!priv->companion)
+ return FALSE;
/* We must not attempt to autoconnect when the companion is connected or
* connecting, * because we'd tear down its connection. */