[PATCH 3/3] qemu: Remove possible NULL deref in debug output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Check for !dev->info.alias was done after a VIR_DEBUG() statement
that already tried to print - just flip sequence

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 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 8011a83..d158a73 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);
-- 
1.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]