aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/zorro8390.c
diff options
context:
space:
mode:
authorroel kluin <roel.kluin@gmail.com>2009-08-09 00:00:25 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-10 00:46:53 -0400
commitbe12159b24c532b4b48bdec5a543336438faa132 (patch)
tree27c2df1d95f482376b108c277a92297c61f6111a /drivers/net/zorro8390.c
parent5e33b719c8fcccfedc1d25167826a0f93fe6c5a1 (diff)
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@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/zorro8390.c')
-rw-r--r--drivers/net/zorro8390.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/zorro8390.c b/drivers/net/zorro8390.c
index 37c84e3b8be0..81c753a617ab 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,
120 for (i = ARRAY_SIZE(cards)-1; i >= 0; i--) 120 for (i = ARRAY_SIZE(cards)-1; i >= 0; i--)
121 if (z->id == cards[i].id) 121 if (z->id == cards[i].id)
122 break; 122 break;
123 if (i < 0)
124 return -ENODEV;
125
123 board = z->resource.start; 126 board = z->resource.start;
124 ioaddr = board+cards[i].offset; 127 ioaddr = board+cards[i].offset;
125 dev = alloc_ei_netdev(); 128 dev = alloc_ei_netdev();