]> xenbits.xensource.com Git - libvirt.git/commitdiff
xen: Don't crash when we fail to init caps
authorGuido Günther <agx@sigxcpu.org>
Fri, 20 Jan 2012 07:56:39 +0000 (08:56 +0100)
committerGuido Günther <agx@sigxcpu.org>
Mon, 23 Jan 2012 11:45:06 +0000 (12:45 +0100)
by dereferencing a NULL pointer in the call to
virNodeSuspendGetTargetMask.

src/xen/xen_hypervisor.c

index 5e7196712f566461761b746d0f05ee01dff9bcd1..b5b2328c22ccffb17f7710b3ed6064907d744215 100644 (file)
@@ -2764,6 +2764,8 @@ xenHypervisorMakeCapabilities(virConnectPtr conn)
                                                  utsname.machine,
                                                  cpuinfo,
                                                  capabilities);
+    if (caps == NULL)
+        return NULL;
 
     if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0)
         VIR_WARN("Failed to get host power management capabilities");