linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tape: beyond ARRAY_SIZE of viocd_diskinfo
@ 2009-05-19 23:10 Roel Kluin
  2009-05-20  0:51 ` Stephen Rothwell
  0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2009-05-19 23:10 UTC (permalink / raw)
  To: sfr; +Cc: lkml, Andrew Morton

Do not go beyond ARRAY_SIZE of tape_device and viotape_unitinfo

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index ffc9254..042c814 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -867,7 +867,7 @@ static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 	int j;
 	struct device_node *node = vdev->dev.archdata.of_node;
 
-	if (i > VIOTAPE_MAX_TAPE)
+	if (i >= VIOTAPE_MAX_TAPE)
 		return -ENODEV;
 	if (!node)
 		return -ENODEV;

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

* Re: [PATCH] tape: beyond ARRAY_SIZE of viocd_diskinfo
  2009-05-19 23:10 Roel Kluin
@ 2009-05-20  0:51 ` Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2009-05-20  0:51 UTC (permalink / raw)
  To: Roel Kluin; +Cc: lkml, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 687 bytes --]

Hi Roel,

On Wed, 20 May 2009 01:10:37 +0200 Roel Kluin <roel.kluin@gmail.com> wrote:
>
> Do not go beyond ARRAY_SIZE of tape_device and viotape_unitinfo
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Good catch.

Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>

If you don't want to trouble with carrying this, please submit it to
linuxppc-dev@ozlabs.org (with my Ack) and they will track it and take
care of it eventually.  This is a legacy driver and noone is likely to
have enough tape drives attached to such a machine so is not an urgent
issue.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* [PATCH] tape: beyond ARRAY_SIZE of viocd_diskinfo
@ 2009-05-20  0:58 Roel Kluin
  0 siblings, 0 replies; 3+ messages in thread
From: Roel Kluin @ 2009-05-20  0:58 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: lkml, Andrew Morton, sfr

Do not go beyond ARRAY_SIZE of tape_device and viotape_unitinfo

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index ffc9254..042c814 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -867,7 +867,7 @@ static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 	int j;
 	struct device_node *node = vdev->dev.archdata.of_node;
 
-	if (i > VIOTAPE_MAX_TAPE)
+	if (i >= VIOTAPE_MAX_TAPE)
 		return -ENODEV;
 	if (!node)
 		return -ENODEV;


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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-20  0:58 [PATCH] tape: beyond ARRAY_SIZE of viocd_diskinfo Roel Kluin
  -- strict thread matches above, loose matches on Subject: below --
2009-05-19 23:10 Roel Kluin
2009-05-20  0:51 ` Stephen Rothwell

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).