From: "Jan Beulich" Subject: [PATCH] xen-blkfront: beyond ARRAY_SIZE of info->shadow Date: Wed, 29 Jul 2009 08:49:21 +0100 Message-ID: <4A701B21020000780000D0C7@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 --- 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 =3D info->shadow_free; - BUG_ON(free > BLK_RING_SIZE); + BUG_ON(free >=3D BLK_RING_SIZE); info->shadow_free =3D info->shadow[free].req.id; info->shadow[free].req.id =3D 0x0fffffee; /* debug */ return free;