diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2020-02-26 16:29:34 +1100 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2020-02-26 20:35:27 +1100 |
commit | 82aed17a5468aff6b600ee1694a10a60f942c018 (patch) | |
tree | 7e9f68cc5fdd7cb61852336e81a8aefcd4fedc25 | |
parent | 16d186cf5025cfa6d98d3d811a9a2475d008cc3d (diff) | |
download | skiboot-82aed17a5468aff6b600ee1694a10a60f942c018.zip skiboot-82aed17a5468aff6b600ee1694a10a60f942c018.tar.gz skiboot-82aed17a5468aff6b600ee1694a10a60f942c018.tar.bz2 |
firenze-pci: Fix infinite loop in firenze_pci_add_loc_code()
If ibm,slot-location-code isn't in a PCI device's parent node the loop
to search for it will never terminate since p = np->parent is always
going to return the same result.
Fixes: ab1b05d29f5e ("PCI: create optional loc-code platform callback")
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
-rw-r--r-- | platforms/ibm-fsp/firenze-pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platforms/ibm-fsp/firenze-pci.c b/platforms/ibm-fsp/firenze-pci.c index efbe552..12e0e98 100644 --- a/platforms/ibm-fsp/firenze-pci.c +++ b/platforms/ibm-fsp/firenze-pci.c @@ -987,7 +987,7 @@ void firenze_pci_add_loc_code(struct dt_node *np, struct pci_device *pd) * prefer fully-qualified slot-location-code, walk-up parent tree * to find one */ - for (p = np->parent; p; p = np->parent) { + for (p = np->parent; p; p = p->parent) { blcode = dt_prop_get_def(p, "ibm,slot-location-code", NULL); if (blcode) break; |