virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/blkfront: beyond ARRAY_SIZE of info->shadow
@ 2009-05-21 18:43 Roel Kluin
  2009-05-21 18:48 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2009-05-21 18:43 UTC (permalink / raw)
  To: jeremy; +Cc: virtualization, Andrew Morton, xen-devel

Do not go beyond ARRAY_SIZE of info->shadow

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index a6cbf7b..d395986 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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen/blkfront: beyond ARRAY_SIZE of info->shadow
  2009-05-21 18:43 [PATCH] xen/blkfront: beyond ARRAY_SIZE of info->shadow Roel Kluin
@ 2009-05-21 18:48 ` Jeremy Fitzhardinge
  2009-05-22  7:16   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Fitzhardinge @ 2009-05-21 18:48 UTC (permalink / raw)
  To: Roel Kluin; +Cc: virtualization, Andrew Morton, xen-devel, jeremy, Jens Axboe

Roel Kluin wrote:
> 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>

Jens, can you put this into a next-merge-window branch?

Thanks,
    J
> ---
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index a6cbf7b..d395986 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;
>
> _______________________________________________
> Virtualization mailing list
> Virtualization@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/virtualization
>
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen/blkfront: beyond ARRAY_SIZE of info->shadow
  2009-05-21 18:48 ` Jeremy Fitzhardinge
@ 2009-05-22  7:16   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2009-05-22  7:16 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: virtualization, Andrew Morton, xen-devel, Roel Kluin, jeremy

On Thu, May 21 2009, Jeremy Fitzhardinge wrote:
> Roel Kluin wrote:
>> 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>
>
> Jens, can you put this into a next-merge-window branch?

Sure, will do.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-22  7:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-21 18:43 [PATCH] xen/blkfront: beyond ARRAY_SIZE of info->shadow Roel Kluin
2009-05-21 18:48 ` Jeremy Fitzhardinge
2009-05-22  7:16   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).