]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
xen_hypervisor.c: avoid NULL deref for NULL domain argument
authorJim Meyering <meyering@redhat.com>
Tue, 26 Jan 2010 19:17:07 +0000 (20:17 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 2 Feb 2010 17:44:32 +0000 (18:44 +0100)
* src/xen/xen_hypervisor.c (xenHypervisorGetVcpus): Don't attempt
to diagnose an unlikely NULL-domain or NULL-domain->conn error.

src/xen/xen_hypervisor.c

index 7f3909511ce52d988e549dcf9ec19190c5a9ab9f..9f76f905380201b9c9eda17cd9b6af6072557a8f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * xen_internal.c: direct access to Xen hypervisor level
  *
- * Copyright (C) 2005, 2006, 2007, 2008, 2009 Red Hat, Inc.
+ * Copyright (C) 2005-2010 Red Hat, Inc.
  *
  * See COPYING.LIB for the License of this software
  *
@@ -3477,11 +3477,8 @@ xenHypervisorGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo,
     virVcpuInfoPtr ipt;
     int nbinfo, i;
 
-    if (domain == NULL || domain->conn == NULL) {
-        virXenErrorFunc (domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__,
-                        "invalid argument", 0);
+    if (domain == NULL || domain->conn == NULL)
         return -1;
-    }
 
     priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
     if (priv->handle < 0 || (domain->id < 0) ||