From: Roel Kluin Date: Fri, 22 May 2009 07:25:32 +0000 (+0200) Subject: xen-blkfront: beyond ARRAY_SIZE of info->shadow X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b9ed7252d219c1c663944bf03846eabb515dbe75;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git xen-blkfront: beyond ARRAY_SIZE of info->shadow Do not go beyond ARRAY_SIZE of info->shadow Signed-off-by: Roel Kluin Acked-by: Jeremy Fitzhardinge Signed-off-by: Jens Axboe --- diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 6d4ac76c2806..6d5950839bd0 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;