summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap/linus/0041-tg3-fix-return-value-check-in-tg3_read_vpd.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/linus/0041-tg3-fix-return-value-check-in-tg3_read_vpd.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap/linus/0041-tg3-fix-return-value-check-in-tg3_read_vpd.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/linus/0041-tg3-fix-return-value-check-in-tg3_read_vpd.patch b/extras/recipes-kernel/linux/linux-omap/linus/0041-tg3-fix-return-value-check-in-tg3_read_vpd.patch
new file mode 100644
index 00000000..c77fb857
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap/linus/0041-tg3-fix-return-value-check-in-tg3_read_vpd.patch
@@ -0,0 +1,35 @@
1From 8742365f4de2afdd0168366b49a3118e67354a21 Mon Sep 17 00:00:00 2001
2From: David Sterba <dsterba@suse.cz>
3Date: Wed, 29 Dec 2010 03:40:31 +0000
4Subject: [PATCH 41/65] tg3: fix return value check in tg3_read_vpd()
5
6Besides -ETIMEDOUT and -EINTR, pci_read_vpd may return other error
7values like -ENODEV or -EINVAL which are ignored due to the buggy
8check, but the data are not read from VPD anyway and this is checked
9subsequently with at most 3 needless loop iterations. This does not
10show up as a runtime bug.
11
12CC: Matt Carlson <mcarlson@broadcom.com>
13CC: Michael Chan <mchan@broadcom.com>
14Signed-off-by: David Sterba <dsterba@suse.cz>
15Signed-off-by: David S. Miller <davem@davemloft.net>
16---
17 drivers/net/tg3.c | 2 +-
18 1 files changed, 1 insertions(+), 1 deletions(-)
19
20diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
21index 30ccbb6..6f97b7b 100644
22--- a/drivers/net/tg3.c
23+++ b/drivers/net/tg3.c
24@@ -12658,7 +12658,7 @@ static void __devinit tg3_read_vpd(struct tg3 *tp)
25 cnt = pci_read_vpd(tp->pdev, pos,
26 TG3_NVM_VPD_LEN - pos,
27 &vpd_data[pos]);
28- if (cnt == -ETIMEDOUT || -EINTR)
29+ if (cnt == -ETIMEDOUT || cnt == -EINTR)
30 cnt = 0;
31 else if (cnt < 0)
32 goto out_not_found;
33--
341.6.6.1
35