Commit e5bded6f authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Kleber Sacilotto de Souza

ARM: exynos: Clear global variable on init error path

BugLink: https://bugs.launchpad.net/bugs/1798587

[ Upstream commit cd480691 ]

For most of Exynos SoCs, Power Management Unit (PMU) address space is
mapped into global variable 'pmu_base_addr' very early when initializing
PMU interrupt controller.  A lot of other machine code depends on it so
when doing iounmap() on this address, clear the global as well to avoid
usage of invalid value (pointing to unmapped memory region).

Properly mapped PMU address space is a requirement for all other machine
code so this fix is purely theoretical.  Boot will fail immediately in
many other places after following this error path.
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent c4d66f45
...@@ -260,6 +260,7 @@ static int __init exynos_pmu_irq_init(struct device_node *node, ...@@ -260,6 +260,7 @@ static int __init exynos_pmu_irq_init(struct device_node *node,
NULL); NULL);
if (!domain) { if (!domain) {
iounmap(pmu_base_addr); iounmap(pmu_base_addr);
pmu_base_addr = NULL;
return -ENOMEM; return -ENOMEM;
} }
......
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