mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
qemu_hotplug: Initialize @charAlias in qemuDomainRemoveChrDevice
My change in 112f3a8d0f
was too drastic. The @charAlias
variable is initialized only if @monitor == true. However, it is
used even outside of that condition, at which point it's just
uninitialized pointer.
Reported-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
4c4ff7a1a0
commit
4b23f18d2c
@ -4754,13 +4754,12 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
|
||||
VIR_DEBUG("Removing character device %s from domain %p %s",
|
||||
chr->info.alias, vm, vm->def->name);
|
||||
|
||||
if (monitor) {
|
||||
if (!(charAlias = qemuAliasChardevFromDevAlias(chr->info.alias)))
|
||||
goto cleanup;
|
||||
if (!(charAlias = qemuAliasChardevFromDevAlias(chr->info.alias)))
|
||||
goto cleanup;
|
||||
|
||||
if (monitor) {
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
rc = qemuMonitorDetachCharDev(priv->mon, charAlias);
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user