mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu_driver.c: avoid NULL dereference upon disk-op failure
* src/qemu/qemu_driver.c (qemudDomainAttachDevice): Call virCgroupDenyDevicePath only if cgroup is non-NULL.
This commit is contained in:
@@ -5491,7 +5491,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
|
||||
virDomainDiskDeviceTypeToString(dev->data.disk->device));
|
||||
/* Fallthrough */
|
||||
}
|
||||
if (ret != 0) {
|
||||
if (ret != 0 && cgroup) {
|
||||
virCgroupDenyDevicePath(cgroup,
|
||||
dev->data.disk->src);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user