mirror of https://gitee.com/openkylin/libvirt.git
usb: fix crash when failing to attach a second usb device
when failing to attach another usb device to a domain for some reason
which has one use device attached before, the libvirtd crashed.
The crash is caused by null-pointer dereference error in invoking
usbDeviceListSteal passed in NULL value usb variable.
commit 05abd1507d
introduces the bug.
This commit is contained in:
parent
38bd605b71
commit
ab5fb8f34c
|
@ -1213,7 +1213,8 @@ error:
|
|||
|
||||
cleanup:
|
||||
usbDeviceListFree(list);
|
||||
usbDeviceListSteal(driver->activeUsbHostdevs, usb);
|
||||
if (usb)
|
||||
usbDeviceListSteal(driver->activeUsbHostdevs, usb);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue