diff options
author | Christoph Egger <Christoph.Egger@amd.com> | 2012-05-29 11:12:45 +0100 |
---|---|---|
committer | Christoph Egger <Christoph.Egger@amd.com> | 2012-05-29 11:12:45 +0100 |
commit | d72f334a2806c99812549cfc04b9e2cdb630ce07 (patch) | |
tree | 3bd820f7e4e6b2e7ac83e1db0f06836e61b7eda1 /tools/xenstore | |
parent | e9f8b0e530baaecc626ba912bfa98897d3cfb1dd (diff) | |
download | xen-d72f334a2806c99812549cfc04b9e2cdb630ce07.tar.gz xen-d72f334a2806c99812549cfc04b9e2cdb630ce07.tar.bz2 xen-d72f334a2806c99812549cfc04b9e2cdb630ce07.zip |
xenstore: fix crash on platforms with no gntdev driver implementation.
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>
Diffstat (limited to 'tools/xenstore')
-rw-r--r-- | tools/xenstore/xenstored_domain.c | 4 |
1 files changed, 2 insertions, 2 deletions
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()); |