[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4A7ED679.3020503@gmail.com>
Date: Sun, 09 Aug 2009 16:00:25 +0200
From: Roel Kluin <roel.kluin@...il.com>
To: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] zorro8390: Fix read buffer overflow in zorro8390_init_one()
Prevent read from cards[-1] when no card was found.
Signed-off-by: Roel Kluin <roel.kluin@...il.com>
---
is ENODEV appropriate here?
diff --git a/drivers/net/zorro8390.c b/drivers/net/zorro8390.c
index 37c84e3..55502e1 100644
--- a/drivers/net/zorro8390.c
+++ b/drivers/net/zorro8390.c
@@ -120,6 +120,9 @@ static int __devinit zorro8390_init_one(struct zorro_dev *z,
for (i = ARRAY_SIZE(cards)-1; i >= 0; i--)
if (z->id == cards[i].id)
break;
+ if (i < 0)
+ return -ENODEV;
+
board = z->resource.start;
ioaddr = board+cards[i].offset;
dev = alloc_ei_netdev();
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists