[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] qemu_driver.c: avoid NULL dereference upon disk-op failure



2009/12/16 Jim Meyering <jim meyering net>:
> The local, "cgroup" is initialized to NULL, and may still
> have that value when the code below is reached.
> That would provoke a NULL-dereference in virCgroupDenyDevicePath.
>
> >From c1caed370a7b2eae2e964a6059b014530143075c Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering redhat com>
> Date: Wed, 16 Dec 2009 14:15:50 +0100
> Subject: [PATCH] qemu_driver.c: avoid NULL dereference upon disk-op failure
>
> * src/qemu/qemu_driver.c (qemudDomainAttachDevice): Call
> virCgroupDenyDevicePath only if cgroup is non-NULL.
> ---
>  src/qemu/qemu_driver.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 9ef6c35..81afecf 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -5485,7 +5485,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);
>         }
> --
> 1.6.6.rc2.275.g51e2d
>

ACK.

Matthias


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]