From e4430e09697bc0bf5b1182732077422092a26521 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 23 Feb 2018 14:52:06 +0100 Subject: [PATCH] libnm/device: use the type name for description if the product is empty It's very likely that the product said something that was filtered out by the fixup, such as "PCI Ethernet" or "Wi-Fi Adapter". Use a generic type name in place of it. --- libnm/nm-device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libnm/nm-device.c b/libnm/nm-device.c index 3a74c4a60a..6d01ec3b10 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -1583,12 +1583,15 @@ ensure_description (NMDevice *device) g_clear_pointer (&priv->description, g_free); } - if ( !priv->short_vendor - || !(short_product = nm_utils_fixup_product_string (nm_device_get_product (device)))) { + if (!priv->short_vendor) { priv->description = g_strdup (nm_device_get_iface (device) ?: ""); return; } + short_product = nm_utils_fixup_product_string (nm_device_get_product (device)); + if (short_product == NULL) + short_product = g_strdup (get_type_name (device)); + /* Another quick hack; if all of the fixed up vendor string * is found in product, ignore the vendor. */