Commit eca3fd83 authored by Brice Goglin's avatar Brice Goglin Committed by Jeff Garzik

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: default avatarBrice Goglin <brice@myri.com>
Signed-off-by: default avatarAndrew Gallatin <gallatin@myri.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 99f5f87e
...@@ -2657,13 +2657,14 @@ static void myri10ge_enable_ecrc(struct myri10ge_priv *mgp) ...@@ -2657,13 +2657,14 @@ static void myri10ge_enable_ecrc(struct myri10ge_priv *mgp)
ext_type = (val & PCI_EXP_FLAGS_TYPE) >> 4; ext_type = (val & PCI_EXP_FLAGS_TYPE) >> 4;
if (ext_type != PCI_EXP_TYPE_ROOT_PORT) { if (ext_type != PCI_EXP_TYPE_ROOT_PORT) {
if (myri10ge_ecrc_enable > 1) { 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 /* Walk the hierarchy up to the root port
* where ECRC has to be enabled */ * where ECRC has to be enabled */
do { do {
prev_bridge = bridge;
bridge = bridge->bus->self; bridge = bridge->bus->self;
if (!bridge) { if (!bridge || prev_bridge == bridge) {
dev_err(dev, dev_err(dev,
"Failed to find root port" "Failed to find root port"
" to force ECRC\n"); " to force ECRC\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment