core: avoid calling platform code with invalid ifindex (2)

Fixes: 945c904f95
This commit is contained in:
Thomas Haller 2018-12-04 13:13:33 +01:00
parent d45eed4437
commit 6ba9f47c94

View file

@ -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;