render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
9119d9
From 41f6c2fa241ddd68564f537ae58af8016d75bf4e Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <41f6c2fa241ddd68564f537ae58af8016d75bf4e@dist-git>
9119d9
From: John Ferlan <jferlan@redhat.com>
9119d9
Date: Tue, 28 Oct 2014 22:28:42 -0400
9119d9
Subject: [PATCH] qemu: Remove possible NULL deref in debug output
9119d9
9119d9
Check for !dev->info.alias was done after a VIR_DEBUG() statement
9119d9
that already tried to print - just flip sequence
9119d9
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=1141621
9119d9
9119d9
(cherry picked from commit b7890a8c28f79e958e5146c85e366f1c69ca1304)
9119d9
Signed-off-by: John Ferlan <jferlan@redhat.com>
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/qemu/qemu_hotplug.c | 4 ++--
9119d9
 1 file changed, 2 insertions(+), 2 deletions(-)
9119d9
9119d9
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
9119d9
index 14acac0..e5e5180 100644
9119d9
--- a/src/qemu/qemu_hotplug.c
9119d9
+++ b/src/qemu/qemu_hotplug.c
9119d9
@@ -1886,14 +1886,14 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
9119d9
     int ret = -1;
9119d9
     qemuDomainObjPrivatePtr priv = vm->privateData;
9119d9
 
9119d9
-    VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate);
9119d9
-
9119d9
     if (!dev->info.alias) {
9119d9
         virReportError(VIR_ERR_OPERATION_FAILED, "%s",
9119d9
                        _("can't change link state: device alias not found"));
9119d9
         return -1;
9119d9
     }
9119d9
 
9119d9
+    VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate);
9119d9
+
9119d9
     qemuDomainObjEnterMonitor(driver, vm);
9119d9
 
9119d9
     ret = qemuMonitorSetLink(priv->mon, dev->info.alias, linkstate);
9119d9
-- 
9119d9
2.1.3
9119d9