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

Submitted by david decotigny on Dec. 16, 2011, 6:19 p.m.

Details

Message ID 077140640823965d09baa7f61b26c7ba9c1b6e68.1324059527.git.decot@googlers.com
State Rejected
Delegated to: David Miller
Headers show

Commit Message

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 hide | download patch | download mbox

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 ==