[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen/blkfront: beyond ARRAY_SIZE of info->shadow


  • To: jeremy@xxxxxxxxxxxxx
  • From: Roel Kluin <roel.kluin@xxxxxxxxx>
  • Date: Thu, 21 May 2009 20:43:30 +0200
  • Cc: virtualization@xxxxxxxxxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 21 May 2009 11:44:16 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=gCAHlFrFFPOh2qLDBcxoWV6xfBuHLciTSo2IUxAFtE6gSKNX38qCESvNBwMUMxixDa YaiAegAU89lutvToe1JrFW0bmdGaOeNqMo9sJXV/woiXaBkDk4SqsRgbOkzv3HJi7alM Wu1+UCoObChigzxVokaCmsPHBAKWe1gUrMbLE=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Do not go beyond ARRAY_SIZE of info->shadow

Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
---
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;


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.