summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-12-04 13:13:33 +0100
committerThomas Haller <thaller@redhat.com>2018-12-04 13:13:34 +0100
commit6ba9f47c94df4a6ec8282238edca22c8d767a171 (patch)
tree08439efdcb75c65d9065ea7b5b4436864d98b7e4
parentd45eed4437fda2bf84a4e5023d99873c42cadf84 (diff)
core: avoid calling platform code with invalid ifindex (2)
-rw-r--r--src/devices/nm-device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 3e48f2005..6af0cf888 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -3641,6 +3641,8 @@ device_link_changed (NMDevice *self)
priv->device_link_changed_id = 0;
ifindex = nm_device_get_ifindex (self);
+ if (ifindex <= 0)
+ return G_SOURCE_REMOVE;
pllink = nm_platform_link_get (nm_device_get_platform (self), ifindex);
if (!pllink)
return G_SOURCE_REMOVE;