summaryrefslogtreecommitdiff
path: root/drivers/soc/tegra
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2019-05-27 12:19:23 +0200
committerThierry Reding <treding@nvidia.com>2019-06-05 09:53:01 +0200
commit03b3c21cb3e69e01008a8151b95fe32ffee30610 (patch)
tree55b983c2f697e51529962c32877b5652c7db3bf5 /drivers/soc/tegra
parent77226d97725034542caadf97a4bb9969d5838ee8 (diff)
soc/tegra: pmc: Avoid crash for non-wake IRQs
For interrupts that are not wakeup sources but that may end up getting mapped through the PMC as interrupt parent (this can happen for GPIOs), return early in order to avoid a subsequent crash from an out-of-bounds access to the register region. Reported-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/soc/tegra')
-rw-r--r--drivers/soc/tegra/pmc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 653fe2c466f6..6e66b5e293be 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -1924,6 +1924,9 @@ static int tegra_pmc_irq_set_wake(struct irq_data *data, unsigned int on)
unsigned int offset, bit;
u32 value;
+ if (WARN_ON(data->hwirq == ULONG_MAX))
+ return 0;
+
offset = data->hwirq / 32;
bit = data->hwirq % 32;