[libvirt] [PATCH] qemu: Fix double free when live-attaching shmem

Michal Privoznik mprivozn at redhat.com
Wed Nov 9 16:47:10 UTC 2016


On 09.11.2016 17:43, Martin Kletzander wrote:
> Function qemuDomainAttachShmemDevice() steals the device data if the
> hotplug was successful, but the condition checked for unsuccessful
> execution otherwise.
> 
> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
> ---
>  src/qemu/qemu_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 38c841420e32..a82e58b29f29 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -7615,7 +7615,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
>      case VIR_DOMAIN_DEVICE_SHMEM:
>          ret = qemuDomainAttachShmemDevice(driver, vm,
>                                            dev->data.shmem);
> -        if (ret < 0) {
> +        if (!ret) {
>              alias = dev->data.shmem->info.alias;
>              dev->data.shmem = NULL;
>          }
> 

ACK

Michal




More information about the libvir-list mailing list