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.
This commit is contained in:
Richard Hughes 2020-04-16 17:09:51 +01:00
parent ca6af0b8f1
commit a89a70cc24

View File

@ -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));