Message ID | 4FA12A20.1030000@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/hw/usb/desc.c b/hw/usb/desc.c index 64352c9..84ea9f2 100644 --- a/hw/usb/desc.c +++ b/hw/usb/desc.c @@ -433,13 +433,11 @@ void usb_desc_create_serial(USBDevice *dev) int index = desc->id.iSerialNumber; char serial[64]; int dst; - char *path = NULL; + char *path; assert(index != 0 && desc->str[index] != NULL); dst = snprintf(serial, sizeof(serial), "%s", desc->str[index]); - if (hcd->parent_bus && hcd->parent_bus->parent) { - path = qdev_get_dev_path(hcd->parent_bus->parent); - } + path = qdev_get_dev_path(hcd); if (path) { dst += snprintf(serial+dst, sizeof(serial)-dst, "-%s", path); }