]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: monitor: Sanitize control flow in qemuMonitorSetCapabilities
authorPeter Krempa <pkrempa@redhat.com>
Tue, 14 Apr 2015 13:17:10 +0000 (15:17 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 15 Apr 2015 11:58:26 +0000 (13:58 +0200)
src/qemu/qemu_monitor.c

index 0606a5f2e89ab101a6131c081a62570e42734ed6..6a6ccf932cacf34cee81c792dc4e3fe1bedc5210 100644 (file)
@@ -1527,7 +1527,6 @@ qemuMonitorEmitSerialChange(qemuMonitorPtr mon,
 int
 qemuMonitorSetCapabilities(qemuMonitorPtr mon)
 {
-    int ret;
     VIR_DEBUG("mon=%p", mon);
 
     if (!mon) {
@@ -1536,16 +1535,10 @@ qemuMonitorSetCapabilities(qemuMonitorPtr mon)
         return -1;
     }
 
-    if (mon->json) {
-        ret = qemuMonitorJSONSetCapabilities(mon);
-        if (ret < 0)
-            goto cleanup;
-    } else {
-        ret = 0;
-    }
+    if (!mon->json)
+        return 0;
 
- cleanup:
-    return ret;
+    return qemuMonitorJSONSetCapabilities(mon);
 }