[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48239891.9020107@myri.com>
Date: Fri, 09 May 2008 02:19:29 +0200
From: Brice Goglin <brice@...i.com>
To: Jeff Garzik <jeff@...zik.org>
CC: netdev@...r.kernel.org
Subject: [PATCH 09/16] myri10ge: fix potential infinite loop in enable_ecrc
Fix another potential for an infinite loop while looking for the
root port in myri10ge_enable_ecrc().
Signed-off-by: Brice Goglin <brice@...i.com>
Signed-off-by: Andrew Gallatin <gallatin@...i.com>
---
drivers/net/myri10ge/myri10ge.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: linux-2.6/drivers/net/myri10ge/myri10ge.c
===================================================================
--- linux-2.6.orig/drivers/net/myri10ge/myri10ge.c 2008-05-09 00:06:20.000000000 +0200
+++ linux-2.6/drivers/net/myri10ge/myri10ge.c 2008-05-09 00:07:17.000000000 +0200
@@ -2657,13 +2657,14 @@
ext_type = (val & PCI_EXP_FLAGS_TYPE) >> 4;
if (ext_type != PCI_EXP_TYPE_ROOT_PORT) {
if (myri10ge_ecrc_enable > 1) {
- struct pci_dev *old_bridge = bridge;
+ struct pci_dev *prev_bridge, *old_bridge = bridge;
/* Walk the hierarchy up to the root port
* where ECRC has to be enabled */
do {
+ prev_bridge = bridge;
bridge = bridge->bus->self;
- if (!bridge) {
+ if (!bridge || prev_bridge == bridge) {
dev_err(dev,
"Failed to find root port"
" to force ECRC\n");
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists