Skip to content

Commit

Permalink
firenze-pci: Fix infinite loop in firenze_pci_add_loc_code()
Browse files Browse the repository at this point in the history
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: ab1b05d ("PCI: create optional loc-code platform callback")
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
oohal committed Feb 26, 2020
1 parent 16d186c commit 82aed17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platforms/ibm-fsp/firenze-pci.c
Expand Up @@ -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;
Expand Down

0 comments on commit 82aed17

Please sign in to comment.