mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
qemu: Fix double free when live-attaching shmem
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@redhat.com>
This commit is contained in:
parent
e66603539b
commit
cca34e38fd
@ -7615,7 +7615,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
|
|||||||
case VIR_DOMAIN_DEVICE_SHMEM:
|
case VIR_DOMAIN_DEVICE_SHMEM:
|
||||||
ret = qemuDomainAttachShmemDevice(driver, vm,
|
ret = qemuDomainAttachShmemDevice(driver, vm,
|
||||||
dev->data.shmem);
|
dev->data.shmem);
|
||||||
if (ret < 0) {
|
if (!ret) {
|
||||||
alias = dev->data.shmem->info.alias;
|
alias = dev->data.shmem->info.alias;
|
||||||
dev->data.shmem = NULL;
|
dev->data.shmem = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user