[PATCH v2 2/4] powerpc/powernv: Fix stale PE primary bus

Andrew Donnellan andrew.donnellan at au1.ibm.com
Fri Feb 12 17:02:46 AEDT 2016


On 09/02/16 15:50, Gavin Shan wrote:
> When PCI bus is unplugged during full hotplug for EEH recovery,
> the platform PE instance (struct pnv_ioda_pe) isn't released and
> it dereferences the stale PCI bus that has been released. It leads
> to kernel crash when referring to the stale PCI bus.
>
> This fixes the issue by correcting the PE's primary bus when it's
> oneline at plugging time, in pnv_pci_dma_bus_setup() which is to
> be called by pcibios_fixup_bus().
>
> Reported-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>
> Reported-by: Pradipta Ghosh <pradghos at in.ibm.com>
> Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
> Tested-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

I realise this has already been merged, but the following was found by 
Coverity:

> +void pnv_pci_dma_bus_setup(struct pci_bus *bus)
> +{
> +	struct pci_controller *hose = bus->sysdata;
> +	struct pnv_phb *phb = hose->private_data;
> +	struct pnv_ioda_pe *pe;
> +
> +	list_for_each_entry(pe, &phb->ioda.pe_list, list) {
> +		if (!(pe->flags | (PNV_IODA_PE_BUS | PNV_IODA_PE_BUS_ALL)))
> +			continue;

This condition is always false. I think the first "|" is supposed to be "&".

-- 
Andrew Donnellan              Software Engineer, OzLabs
andrew.donnellan at au1.ibm.com  Australia Development Lab, Canberra
+61 2 6201 8874 (work)        IBM Australia Limited



More information about the Linuxppc-dev mailing list