From a89a70cc24a37acbae05753734b8cf13f872d2f5 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 16 Apr 2020 17:09:51 +0100 Subject: [PATCH] trivial: Do not set the device parent when already set to the client This can happen if the devices swap roles, and if the parent is set as itself then fwupdmgr refuses to show the child device. --- src/fu-device-list.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fu-device-list.c b/src/fu-device-list.c index 8e3b6982b..fc6866e78 100644 --- a/src/fu-device-list.c +++ b/src/fu-device-list.c @@ -565,6 +565,8 @@ fu_device_list_replace (FuDeviceList *self, FuDeviceItem *item, FuDevice *device /* copy the parent if not already set */ if (fu_device_get_parent (item->device) != NULL && + fu_device_get_parent (item->device) != device && + fu_device_get_parent (device) != item->device && fu_device_get_parent (device) == NULL) { FuDevice *parent = fu_device_get_parent (item->device); g_debug ("copying parent %s to new device", fu_device_get_id (parent));