From: Keir Fraser Date: Wed, 29 Jul 2009 08:21:40 +0000 (+0100) Subject: xen-blkfront: beyond ARRAY_SIZE of info->shadow X-Git-Tag: xen-3.4.2~19 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4ae368fb09f79aa36aa510f05ac92a9b018293c2;p=legacy%2Flinux-2.6.18-xen.git xen-blkfront: beyond ARRAY_SIZE of info->shadow Import upstream pv-ops change b9ed7252d219c1c663944bf03846eabb515dbe75: Do not go beyond ARRAY_SIZE of info->shadow Signed-off-by: Roel Kluin Acked-by: Jeremy Fitzhardinge Signed-off-by: Jens Axboe Signed-off-by: Jan Beulich --- diff --git a/drivers/xen/blkfront/blkfront.c b/drivers/xen/blkfront/blkfront.c index 799fecda..78b8855a 100644 --- a/drivers/xen/blkfront/blkfront.c +++ b/drivers/xen/blkfront/blkfront.c @@ -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;