Skip to content

Commit 11c2bf4

Browse files
paliLorenzo Pieralisi
authored andcommitted
PCI: mvebu: Handle invalid size of read config request
Function mvebu_pcie_hw_rd_conf() does not handle invalid size. So correctly set read value to all-ones and return appropriate error return value PCIBIOS_BAD_REGISTER_NUMBER like in mvebu_pcie_hw_wr_conf() function. Link: https://lore.kernel.org/r/20211125124605.25915-5-pali@kernel.org Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
1 parent 489bfc5 commit 11c2bf4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/pci/controller/pci-mvebu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ static int mvebu_pcie_hw_rd_conf(struct mvebu_pcie_port *port,
250250
case 4:
251251
*val = readl_relaxed(conf_data);
252252
break;
253+
default:
254+
*val = 0xffffffff;
255+
return PCIBIOS_BAD_REGISTER_NUMBER;
253256
}
254257

255258
return PCIBIOS_SUCCESSFUL;

0 commit comments

Comments
 (0)