diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 409d28841d..a91c7095e6 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1173,8 +1173,10 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver, goto cleanup; } - if (qemuPrepareHostdevUSBDevices(driver, vm->def->name, list) < 0) + if (qemuPrepareHostdevUSBDevices(driver, vm->def->name, list) < 0) { + usb = NULL; goto cleanup; + } usbDeviceListSteal(list, usb); }