Skip to content

Commit

Permalink
powerpc/iseries: Fix possible null pointer dereference in iSeries_pci…
Browse files Browse the repository at this point in the history
…bios_fixup_resources

I don't know if this is a right fix for the problem
since of_get_property can return NULL.
Since iseries_device_information is used only for informational purpose,
we can skip this function without valid HvSubBusNumber number.

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Denis Kirjanov authored and Benjamin Herrenschmidt committed Jul 8, 2010
1 parent 33ad5e4 commit d3005fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/powerpc/platforms/iseries/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,11 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
}

allocate_device_bars(pdev);
iseries_device_information(pdev, bus, *sub_bus);
if (likely(sub_bus))
iseries_device_information(pdev, bus, *sub_bus);
else
printk(KERN_ERR "PCI: Device node %s has missing or invalid "
"linux,subbus property\n", node->full_name);
}

/*
Expand Down

0 comments on commit d3005fb

Please sign in to comment.