mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-20 03:25:18 +00:00
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 05abd1507d66aabb6cad12eeafeb4c4d1911c585 introduces the bug. (cherry picked from commit ab5fb8f34c93661bb19b62e4ed3592fb53cd6b36)
This commit is contained in:
parent
d1186c589f
commit
48b9eb2d55
@ -1213,7 +1213,8 @@ error:
|
||||
|
||||
cleanup:
|
||||
usbDeviceListFree(list);
|
||||
usbDeviceListSteal(driver->activeUsbHostdevs, usb);
|
||||
if (usb)
|
||||
usbDeviceListSteal(driver->activeUsbHostdevs, usb);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user