Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be12159b authored by roel kluin's avatar roel kluin Committed by David S. Miller
Browse files

zorro8390: Fix read buffer overflow in zorro8390_init_one()



Prevent read from cards[-1] when no card was found.

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5e33b719
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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();