Skip to content

Commit

Permalink
zorro8390: Fix read buffer overflow in zorro8390_init_one()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
roel kluin authored and David S. Miller committed Aug 10, 2009
1 parent 5e33b71 commit be12159
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/zorro8390.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit be12159

Please sign in to comment.