diff options
author | Pali Rohár <pali@kernel.org> | 2021-11-25 13:45:54 +0100 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2022-01-04 15:58:35 +0100 |
commit | 11c2bf4a20c256eea258a4332244c0deb9af0da8 (patch) | |
tree | b6a3902ba55bcd2c793f64bff97e8474792c2029 /drivers/pci/controller/pci-mvebu.c | |
parent | PCI: mvebu: Check that PCI bridge specified in DT has function number zero (diff) | |
download | linux-11c2bf4a20c256eea258a4332244c0deb9af0da8.tar.xz linux-11c2bf4a20c256eea258a4332244c0deb9af0da8.zip |
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>
Diffstat (limited to 'drivers/pci/controller/pci-mvebu.c')
-rw-r--r-- | drivers/pci/controller/pci-mvebu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index 2a2100c2e65d..8388a9cc911d 100644 --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c @@ -250,6 +250,9 @@ static int mvebu_pcie_hw_rd_conf(struct mvebu_pcie_port *port, case 4: *val = readl_relaxed(conf_data); break; + default: + *val = 0xffffffff; + return PCIBIOS_BAD_REGISTER_NUMBER; } return PCIBIOS_SUCCESSFUL; |