diff options
author | David Sterba <dsterba@suse.cz> | 2010-12-28 22:40:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-31 15:31:01 -0500 |
commit | 824f5f38d3005c346a043dedcfe8b048b699b81a (patch) | |
tree | 81d9f10bf6dabd5b2a439bf9805892d5d056127b | |
parent | f7e4c9775ea648deed4a8193951e50d0c7706173 (diff) |
tg3: fix return value check in tg3_read_vpd()
Besides -ETIMEDOUT and -EINTR, pci_read_vpd may return other error
values like -ENODEV or -EINVAL which are ignored due to the buggy
check, but the data are not read from VPD anyway and this is checked
subsequently with at most 3 needless loop iterations. This does not
show up as a runtime bug.
CC: Matt Carlson <mcarlson@broadcom.com>
CC: Michael Chan <mchan@broadcom.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/tg3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 30ccbb6d097a..6f97b7bbcbf1 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -12658,7 +12658,7 @@ static void __devinit tg3_read_vpd(struct tg3 *tp) | |||
12658 | cnt = pci_read_vpd(tp->pdev, pos, | 12658 | cnt = pci_read_vpd(tp->pdev, pos, |
12659 | TG3_NVM_VPD_LEN - pos, | 12659 | TG3_NVM_VPD_LEN - pos, |
12660 | &vpd_data[pos]); | 12660 | &vpd_data[pos]); |
12661 | if (cnt == -ETIMEDOUT || -EINTR) | 12661 | if (cnt == -ETIMEDOUT || cnt == -EINTR) |
12662 | cnt = 0; | 12662 | cnt = 0; |
12663 | else if (cnt < 0) | 12663 | else if (cnt < 0) |
12664 | goto out_not_found; | 12664 | goto out_not_found; |