From 6f29ed9f3f12062fcdf8c37a1177eb13dcda99e5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 20 Jul 2020 16:11:25 +0200 Subject: device: fix setting %NULL iface in nm_device_update_from_platform_link() Fixes: f004e7b1a720 ('device: mark ifindex/iface fields of NMDevicePrivate as const') --- src/devices/nm-device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 22c255ecf6..90ca3eddd5 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -4717,8 +4717,9 @@ nm_device_update_from_platform_link (NMDevice *self, const NMPlatformLink *plink _notify (self, PROP_PATH); } - str = plink ? plink->name : NULL; - if (nm_utils_strdup_reset (&priv->iface_, str)) + if ( plink + && !nm_str_is_empty (plink->name) + && nm_utils_strdup_reset (&priv->iface_, plink->name)) _notify (self, PROP_IFACE); str = plink ? plink->driver : NULL; -- cgit v1.2.1