From 6ba9f47c94df4a6ec8282238edca22c8d767a171 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 4 Dec 2018 13:13:33 +0100 Subject: [PATCH] core: avoid calling platform code with invalid ifindex (2) Fixes: 945c904f956580616f0d71b13c63f525c184060c --- src/devices/nm-device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 3e48f2005a..6af0cf8889 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;