From b7890a8c28f79e958e5146c85e366f1c69ca1304 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Wed, 24 Sep 2014 08:30:09 -0400 Subject: [PATCH] qemu: Remove possible NULL deref in debug output Check for !dev->info.alias was done after a VIR_DEBUG() statement that already tried to print - just flip sequence --- src/qemu/qemu_hotplug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index bc683e036a..1e504ec591 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1887,14 +1887,14 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver, int ret = -1; qemuDomainObjPrivatePtr priv = vm->privateData; - VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate); - if (!dev->info.alias) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("can't change link state: device alias not found")); return -1; } + VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate); + qemuDomainObjEnterMonitor(driver, vm); ret = qemuMonitorSetLink(priv->mon, dev->info.alias, linkstate);