]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
xen-blkfront: beyond ARRAY_SIZE of info->shadow
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 29 Jul 2009 08:21:40 +0000 (09:21 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 29 Jul 2009 08:21:40 +0000 (09:21 +0100)
Import upstream pv-ops change
b9ed7252d219c1c663944bf03846eabb515dbe75:

Do not go beyond ARRAY_SIZE of info->shadow
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
drivers/xen/blkfront/blkfront.c

index 799fecdaa414dd5bdd2be8a935845d1f965f950a..78b8855a183df20d8c5478bddbfbc4be585f68ce 100644 (file)
@@ -428,7 +428,7 @@ static inline 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;