Commit 826a816f authored by Krzysztof Halasa's avatar Krzysztof Halasa Committed by Greg Kroah-Hartman

CNS3xxx: Fix PCI cns3xxx_write_config()

commit 88e9da9a upstream.

The "where" offset was added twice, fix it.
Signed-off-by: default avatarKrzysztof Hałasa <khalasa@piap.pl>
Fixes: 498a92d4 ("ARM: cns3xxx: pci: avoid potential stack overflow")
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3fb17a4d
......@@ -220,13 +220,13 @@ static void cns3xxx_write_config(struct cns3xxx_pcie *cnspci,
u32 mask = (0x1ull << (size * 8)) - 1;
int shift = (where % 4) * 8;
v = readl_relaxed(base + (where & 0xffc));
v = readl_relaxed(base);
v &= ~(mask << shift);
v |= (val & mask) << shift;
writel_relaxed(v, base + (where & 0xffc));
readl_relaxed(base + (where & 0xffc));
writel_relaxed(v, base);
readl_relaxed(base);
}
static void __init cns3xxx_pcie_hw_init(struct cns3xxx_pcie *cnspci)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment