From d72f334a2806c99812549cfc04b9e2cdb630ce07 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Tue, 29 May 2012 11:12:45 +0100 Subject: xenstore: fix crash on platforms with no gntdev driver implementation. Fix pointer checks introduced in changeset 24757:aae516b78fce. Signed-off-by: Christoph Egger Acked-by: Ian Campbell Acked-by: Ian Jackson Committed-by: Ian Campbell --- tools/xenstore/xenstored_domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/xenstore') diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c index f8c822f46e..bf83d5830b 100644 --- a/tools/xenstore/xenstored_domain.c +++ b/tools/xenstore/xenstored_domain.c @@ -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()); -- cgit v1.2.3