Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoel Kluin <12o3l@tiscali.nl>2008-05-11 10:59:44 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2008-05-15 07:50:06 -0700
commitfa5c104c2465470dc316bf211257f9e67e0ba602 (patch)
tree2f94101a17238537547b65187819ab7baee7eb4e
parentcfa4a0793f4bc4a6ab83657612b88b266d43b5ab (diff)
r8169: fix past rtl_chip_info array size for unknown chipsets
commit cee60c377de6d9d10f0a2876794149bd79a15020 upstream. 'i' is unsigned. Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Acked-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/net/r8169.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 3acfeeabdee1..5e8ad634490f 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1705,18 +1705,18 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
rtl8169_print_mac_version(tp);
- for (i = ARRAY_SIZE(rtl_chip_info) - 1; i >= 0; i--) {
+ for (i = 0; i < ARRAY_SIZE(rtl_chip_info); i++) {
if (tp->mac_version == rtl_chip_info[i].mac_version)
break;
}
- if (i < 0) {
+ if (i == ARRAY_SIZE(rtl_chip_info)) {
/* Unknown chip: assume array element #0, original RTL-8169 */
if (netif_msg_probe(tp)) {
dev_printk(KERN_DEBUG, &pdev->dev,
"unknown chip version, assuming %s\n",
rtl_chip_info[0].name);
}
- i++;
+ i = 0;
}
tp->chipset = i;