]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-omap/linus/0041-tg3-fix-return-value-check-in-tg3_read_vpd.patch
move kernel recipes in to the proper dir
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-omap / linus / 0041-tg3-fix-return-value-check-in-tg3_read_vpd.patch
1 From 8742365f4de2afdd0168366b49a3118e67354a21 Mon Sep 17 00:00:00 2001
2 From: David Sterba <dsterba@suse.cz>
3 Date: Wed, 29 Dec 2010 03:40:31 +0000
4 Subject: [PATCH 41/65] tg3: fix return value check in tg3_read_vpd()
6 Besides -ETIMEDOUT and -EINTR, pci_read_vpd may return other error
7 values like -ENODEV or -EINVAL which are ignored due to the buggy
8 check, but the data are not read from VPD anyway and this is checked
9 subsequently with at most 3 needless loop iterations. This does not
10 show up as a runtime bug.
12 CC: Matt Carlson <mcarlson@broadcom.com>
13 CC: Michael Chan <mchan@broadcom.com>
14 Signed-off-by: David Sterba <dsterba@suse.cz>
15 Signed-off-by: David S. Miller <davem@davemloft.net>
16 ---
17  drivers/net/tg3.c |    2 +-
18  1 files changed, 1 insertions(+), 1 deletions(-)
20 diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
21 index 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 -- 
34 1.6.6.1