linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cdrom: beyond ARRAY_SIZE of viocd_diskinfo
@ 2009-05-19 23:03 Roel Kluin
  2009-05-20  6:42 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-05-19 23:03 UTC (permalink / raw)
  To: axboe; +Cc: lkml, Andrew Morton

Do not go beyond ARRAY_SIZE of viocd_diskinfo

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index 1392935..9b1624e 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -587,7 +587,7 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 	struct device_node *node = vdev->dev.archdata.of_node;
 
 	deviceno = vdev->unit_address;
-	if (deviceno > VIOCD_MAX_CD)
+	if (deviceno >= VIOCD_MAX_CD)
 		return -ENODEV;
 	if (!node)
 		return -ENODEV;


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

* Re: [PATCH] cdrom: beyond ARRAY_SIZE of viocd_diskinfo
  2009-05-19 23:03 [PATCH] cdrom: beyond ARRAY_SIZE of viocd_diskinfo Roel Kluin
@ 2009-05-20  6:42 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2009-05-20  6:42 UTC (permalink / raw)
  To: Roel Kluin; +Cc: lkml, Andrew Morton

On Wed, May 20 2009, Roel Kluin wrote:
> Do not go beyond ARRAY_SIZE of viocd_diskinfo

Good catch, applied.

> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
> index 1392935..9b1624e 100644
> --- a/drivers/cdrom/viocd.c
> +++ b/drivers/cdrom/viocd.c
> @@ -587,7 +587,7 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
>  	struct device_node *node = vdev->dev.archdata.of_node;
>  
>  	deviceno = vdev->unit_address;
> -	if (deviceno > VIOCD_MAX_CD)
> +	if (deviceno >= VIOCD_MAX_CD)
>  		return -ENODEV;
>  	if (!node)
>  		return -ENODEV;
> 

-- 
Jens Axboe


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

end of thread, other threads:[~2009-05-20  6:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-19 23:03 [PATCH] cdrom: beyond ARRAY_SIZE of viocd_diskinfo Roel Kluin
2009-05-20  6:42 ` 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).