From c3b180198fe10d1fe84fea8b9944834be4f4ad56 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 17 May 2017 15:01:10 +0200 Subject: [PATCH] device: make UDI property construct-only (cherry picked from commit e216d5eac0768b5936f3415cde7808982c74f0ac) --- src/devices/nm-device.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 0536f13881..a75ea1fea2 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -13893,14 +13893,11 @@ set_property (GObject *object, guint prop_id, switch (prop_id) { case PROP_UDI: - if (g_value_get_string (value)) { - g_free (priv->udi); - priv->udi = g_value_dup_string (value); - } + /* construct-only */ + priv->udi = g_value_dup_string (value); break; case PROP_IFACE: /* construct-only */ - g_return_if_fail (!priv->iface); priv->iface = g_value_dup_string (value); break; case PROP_DRIVER: @@ -14211,7 +14208,7 @@ nm_device_class_init (NMDeviceClass *klass) obj_properties[PROP_UDI] = g_param_spec_string (NM_DEVICE_UDI, "", "", NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT | + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); obj_properties[PROP_IFACE] = g_param_spec_string (NM_DEVICE_IFACE, "", "",