提交 ab5fb8f3 编写于 作者: G Guannan Ren

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 05abd150 introduces the bug.
上级 38bd605b
......@@ -1213,7 +1213,8 @@ error:
cleanup:
usbDeviceListFree(list);
usbDeviceListSteal(driver->activeUsbHostdevs, usb);
if (usb)
usbDeviceListSteal(driver->activeUsbHostdevs, usb);
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册