8139too: fix buffer overrun in rtl8139_init_board
authorDenis Kirjanov <dkirjanov@kernel.org>
Mon, 7 Jun 2010 08:13:57 +0000 (01:13 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Jun 2010 08:13:57 +0000 (01:13 -0700)
Fix rtl_chip_info buffer overrun when we can't identify the chip.
(i = ARRAY_SIZE (rtl_chip_info) in this case)

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/8139too.c

index 4ba72933f0da57b72f069e4d95a29fc1ad8da1f1..80cd074d3817944bf65751482fc9cb0fc331f088 100644 (file)
@@ -860,6 +860,7 @@ retry:
                }
 
        /* if unknown chip, assume array element #0, original RTL-8139 in this case */
+       i = 0;
        dev_dbg(&pdev->dev, "unknown chip version, assuming RTL-8139\n");
        dev_dbg(&pdev->dev, "TxConfig = 0x%lx\n", RTL_R32 (TxConfig));
        tp->chipset = 0;