virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/blkfront: beyond ARRAY_SIZE of info->shadow
@ 2009-05-21 18:43 Roel Kluin
  2009-05-21 18:48 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2009-05-21 18:43 UTC (permalink / raw)
  To: jeremy; +Cc: virtualization, Andrew Morton, xen-devel

Do not go beyond ARRAY_SIZE of info->shadow

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index a6cbf7b..d395986 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -122,7 +122,7 @@ static DEFINE_SPINLOCK(blkif_io_lock);
 static int get_id_from_freelist(struct blkfront_info *info)
 {
 	unsigned long free = info->shadow_free;
-	BUG_ON(free > BLK_RING_SIZE);
+	BUG_ON(free >= BLK_RING_SIZE);
 	info->shadow_free = info->shadow[free].req.id;
 	info->shadow[free].req.id = 0x0fffffee; /* debug */
 	return free;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-22  7:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-21 18:43 [PATCH] xen/blkfront: beyond ARRAY_SIZE of info->shadow Roel Kluin
2009-05-21 18:48 ` Jeremy Fitzhardinge
2009-05-22  7:16   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).