Skip to content

Commit b1bd571

Browse files
paliLorenzo Pieralisi
authored andcommitted
PCI: aardvark: Indicate error in 'val' when config read fails
Most callers of config read do not check for return value. But most of the ones that do, checks for error indication in 'val' variable. This patch updates error handling in advk_pcie_rd_conf() function. If PIO transfer fails then 'val' variable is set to 0xffffffff which indicates failture. Link: https://lore.kernel.org/r/20200528162604.GA323482@bjorn-Precision-5520 Link: https://lore.kernel.org/r/[email protected] Reported-by: Bjorn Helgaas <[email protected]> Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]>
1 parent b3a9e3b commit b1bd571

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/pci/controller/pci-aardvark.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,10 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
688688
advk_writel(pcie, 1, PIO_START);
689689

690690
ret = advk_pcie_wait_pio(pcie);
691-
if (ret < 0)
691+
if (ret < 0) {
692+
*val = 0xffffffff;
692693
return PCIBIOS_SET_FAILED;
694+
}
693695

694696
advk_pcie_check_pio_status(pcie);
695697

0 commit comments

Comments
 (0)