]> xenbits.xensource.com Git - people/vhanquez/xen-unstable.git/commitdiff
xenstore: fix crash on platforms with no gntdev driver implementation.
authorChristoph Egger <Christoph.Egger@amd.com>
Tue, 29 May 2012 10:12:45 +0000 (11:12 +0100)
committerChristoph Egger <Christoph.Egger@amd.com>
Tue, 29 May 2012 10:12:45 +0000 (11:12 +0100)
Fix pointer checks introduced in changeset 24757:aae516b78fce.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/xenstore/xenstored_domain.c

index f8c822f46e24561a2f60651170e395c45044dc89..bf83d5830b8130854dc2fa59a33501c7271cba66 100644 (file)
@@ -167,7 +167,7 @@ static int readchn(struct connection *conn, void *data, unsigned int len)
 
 static void *map_interface(domid_t domid, unsigned long mfn)
 {
-       if (*xcg_handle >= 0) {
+       if (*xcg_handle != NULL) {
                /* this is the preferred method */
                return xc_gnttab_map_grant_ref(*xcg_handle, domid,
                        GNTTAB_RESERVED_XENSTORE, PROT_READ|PROT_WRITE);
@@ -179,7 +179,7 @@ static void *map_interface(domid_t domid, unsigned long mfn)
 
 static void unmap_interface(void *interface)
 {
-       if (*xcg_handle >= 0)
+       if (*xcg_handle != NULL)
                xc_gnttab_munmap(*xcg_handle, interface, 1);
        else
                munmap(interface, getpagesize());