From 4080ef637e44cf19815829d1e0fa35778f45c8fe Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 11 Mar 2022 12:31:53 +0000 Subject: [PATCH] trivial: Do not show SATA drives as SCSI devices This fixes a regression in c4ca02629487d3f26278f47e4720167b1ae04eb4 which meant the 'vendor' sysfs attribute wasn't being stripped before being used as the vendor ID. --- plugins/scsi/fu-scsi-device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/scsi/fu-scsi-device.c b/plugins/scsi/fu-scsi-device.c index 277d07975..6d04763ef 100644 --- a/plugins/scsi/fu-scsi-device.c +++ b/plugins/scsi/fu-scsi-device.c @@ -21,6 +21,7 @@ fu_scsi_device_probe(FuDevice *device, GError **error) const gchar *vendor; const gchar *version; g_autofree gchar *vendor_id = NULL; + g_autofree gchar *vendor_safe = NULL; g_autoptr(GPtrArray) block_devs = NULL; /* ignore */ @@ -34,7 +35,8 @@ fu_scsi_device_probe(FuDevice *device, GError **error) /* vendor */ vendor = fu_udev_device_get_sysfs_attr(FU_UDEV_DEVICE(device), "vendor", NULL); - if (vendor == NULL || g_strcmp0(vendor, "ATA") == 0) { + vendor_safe = fu_common_strstrip(vendor); + if (vendor_safe == NULL || g_strcmp0(vendor_safe, "ATA") == 0) { g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, @@ -42,7 +44,7 @@ fu_scsi_device_probe(FuDevice *device, GError **error) return FALSE; } fu_device_set_vendor(device, vendor); - vendor_id = g_strdup_printf("SCSI:%s", vendor); + vendor_id = g_strdup_printf("SCSI:%s", vendor_safe); fu_device_add_vendor_id(device, vendor_id); /* name */