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

https://bugzilla.redhat.com/show_bug.cgi?id=1659790

Fixes: 945c904f95
This commit is contained in:
Thomas Haller 2018-12-16 20:34:23 +01:00
parent 90e9695af5
commit f877ba8c04

View file

@ -14498,6 +14498,7 @@ nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason, CleanupType clean
/* slave: mark no longer enslaved */
if ( priv->master
&& priv->ifindex > 0
&& nm_platform_link_get_master (nm_device_get_platform (self), priv->ifindex) <= 0)
nm_device_master_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);