All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] minios: fix gnttab allocation boundary
@ 2008-06-17 16:54 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2008-06-17 16:54 UTC (permalink / raw)
  To: xen-devel

minios: fix gnttab allocation boundary

The gnttab_sem is already fed during initialization's put_free_entry
loop.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>

diff -r 78f90b0f707f extras/mini-os/gnttab.c
--- a/extras/mini-os/gnttab.c	Tue Jun 17 14:45:18 2008 +0100
+++ b/extras/mini-os/gnttab.c	Tue Jun 17 17:53:51 2008 +0100
@@ -35,7 +35,7 @@
 #ifdef GNT_DEBUG
 static char inuse[NR_GRANT_ENTRIES];
 #endif
-static __DECLARE_SEMAPHORE_GENERIC(gnttab_sem, NR_GRANT_ENTRIES);
+static __DECLARE_SEMAPHORE_GENERIC(gnttab_sem, 0);
 
 static void
 put_free_entry(grant_ref_t ref)
@@ -60,6 +60,7 @@
     down(&gnttab_sem);
     local_irq_save(flags);
     ref = gnttab_list[0];
+    BUG_ON(ref < NR_RESERVED_ENTRIES || ref >= NR_GRANT_ENTRIES);
     gnttab_list[0] = gnttab_list[ref];
 #ifdef GNT_DEBUG
     BUG_ON(inuse[ref]);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-17 16:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-17 16:54 [PATCH] minios: fix gnttab allocation boundary Samuel Thibault

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.