All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] cdrom: beyond ARRAY_SIZE of viocd_diskinfo
Date: Wed, 20 May 2009 08:42:37 +0200	[thread overview]
Message-ID: <20090520064237.GB11363@kernel.dk> (raw)
In-Reply-To: <4A133AA7.6020508@gmail.com>

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


      reply	other threads:[~2009-05-20  6:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19 23:03 [PATCH] cdrom: beyond ARRAY_SIZE of viocd_diskinfo Roel Kluin
2009-05-20  6:42 ` Jens Axboe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090520064237.GB11363@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roel.kluin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.