]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_driver.c: avoid NULL dereference upon disk-op failure
authorJim Meyering <meyering@redhat.com>
Wed, 16 Dec 2009 13:15:50 +0000 (14:15 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 5 Jan 2010 16:25:19 +0000 (17:25 +0100)
* src/qemu/qemu_driver.c (qemudDomainAttachDevice): Call
virCgroupDenyDevicePath only if cgroup is non-NULL.

src/qemu/qemu_driver.c

index a6a1a5ab7cecfcbc02fd2f93f6e761b6072785ef..4639478abc61d34ce4bb3bed28fe740567d4596e 100644 (file)
@@ -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);
         }