Jan Beulich
2009-Jul-29 07:49 UTC
[Xen-devel] [PATCH] 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 <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> --- 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; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel