提交 879cd8cc 编写于 作者: D Daniel P. Berrange

Fix crash in device hotplug cleanup code

* src/qemu/qemu_driver.c: Fix crash in scenario where XML
  parsing of hotplugged device failed & thus 'dev' is NULL
上级 46da3550
...@@ -4880,7 +4880,7 @@ cleanup: ...@@ -4880,7 +4880,7 @@ cleanup:
if (cgroup) if (cgroup)
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
if (ret < 0) { if (ret < 0 && dev != NULL) {
if (qemuDomainSetDeviceOwnership(dom->conn, driver, dev, 1) < 0) if (qemuDomainSetDeviceOwnership(dom->conn, driver, dev, 1) < 0)
VIR_WARN0("Fail to restore disk device ownership"); VIR_WARN0("Fail to restore disk device ownership");
virDomainDeviceDefFree(dev); virDomainDeviceDefFree(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册