Never hang in g_udev_device_get_parent() if there is never a busnum

Spotted by Coverity.
This commit is contained in:
Richard Hughes 2022-11-03 17:27:41 +00:00 committed by Mario Limonciello
parent 44f816e1c6
commit 26e1b7c49b

View File

@ -2116,7 +2116,7 @@ fu_udev_device_find_usb_device(FuUdevDevice *self, GError **error)
g_return_val_if_fail(error == NULL || *error == NULL, NULL);
/* look at the current device and all the parent devices until we can find the USB data */
while (TRUE) {
while (udev_device != NULL) {
g_autoptr(GUdevDevice) udev_device_parent = NULL;
bus = g_udev_device_get_sysfs_attr_as_int(udev_device, "busnum");
address = g_udev_device_get_sysfs_attr_as_int(udev_device, "devnum");