WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: jeremy@xxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xen/blkfront: beyond ARRAY_SIZE of info->shadow
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=tQmNwHcHJSef65hPqSxHY0M5aN6OeLyUt1efYJJmCK4=; b=OWDIF6kY3wrU+/JdhCJK/SAT+FFcwfszbFme8ycnxuBD48LTKlc/P665K98XaXX7CS 8+KFu8iHpz8A37Y8+9ThhoqFW7HEgg5p/EoTetBuHDG2T7QHkMRW4wORWE1g2LF189If WIRN+XBJtOAxX8W87BRc7A1LlEp/RxoiUJq1Y=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.21 (X11/20090302)
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

<Prev in Thread] Current Thread [Next in Thread>