Patchwork [net-next,v1,1/6] tg3: fix possible infinite loop

login
register
mail settings
Submitter david decotigny
Date Dec. 16, 2011, 6:19 p.m.
Message ID <077140640823965d09baa7f61b26c7ba9c1b6e68.1324059527.git.decot@googlers.com>
Download mbox | patch
Permalink /patch/131881/
State Rejected
Delegated to: David Miller
Headers show

Comments

david decotigny - Dec. 16, 2011, 6:19 p.m.
Found by browsing the code.

Tested:
  Not tested along the affected path. No regression observed.



Signed-off-by: David Decotigny <decot@googlers.com>
---
 drivers/net/ethernet/broadcom/tg3.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 8bf11ca..e04c4f9 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -13877,8 +13877,10 @@  static int __devinit tg3_get_invariants(struct tg3 *tp)
 				continue;
 			}
 			if (pci_id->rev != PCI_ANY_ID) {
-				if (bridge->revision > pci_id->rev)
+				if (bridge->revision > pci_id->rev) {
+					pci_id++;
 					continue;
+				}
 			}
 			if (bridge->subordinate &&
 			    (bridge->subordinate->number ==