forked from Minki/linux
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>
This commit is contained in:
parent
5e33b719c8
commit
be12159b24
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user