From 88dd7ba72b83eb817c7e787c082b23404a7521d0 Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Tue, 29 Dec 2009 23:28:13 +0000 Subject: [PATCH] Correct bug introduced while purging the -ERRNO Linuxism from the grant table API. Valid grant refs are in the range of positive 32bit integers. ENOSPACE, being 29, is also a positive integer. Return GNTTAB_LIST_END (-1) instead when gnttab_claim_grant_reference() fails. --- sys/xen/gnttab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/xen/gnttab.c b/sys/xen/gnttab.c index d05790bbf84f..ae44e8f6a8f5 100644 --- a/sys/xen/gnttab.c +++ b/sys/xen/gnttab.c @@ -325,7 +325,7 @@ gnttab_claim_grant_reference(grant_ref_t *private_head) grant_ref_t g = *private_head; if (unlikely(g == GNTTAB_LIST_END)) - return (ENOSPC); + return (g); *private_head = gnttab_entry(g); return (g); }