提交 eebf932e 编写于 作者: J Jim Meyering

qemu_driver.c: avoid NULL dereference upon disk-op failure

* src/qemu/qemu_driver.c (qemudDomainAttachDevice): Call
virCgroupDenyDevicePath only if cgroup is non-NULL.
上级 c1237818
...@@ -5491,7 +5491,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom, ...@@ -5491,7 +5491,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
virDomainDiskDeviceTypeToString(dev->data.disk->device)); virDomainDiskDeviceTypeToString(dev->data.disk->device));
/* Fallthrough */ /* Fallthrough */
} }
if (ret != 0) { if (ret != 0 && cgroup) {
virCgroupDenyDevicePath(cgroup, virCgroupDenyDevicePath(cgroup,
dev->data.disk->src); dev->data.disk->src);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册