summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorThierry Reding2019-05-27 12:19:23 +0200
committerThierry Reding2019-06-05 09:53:01 +0200
commit03b3c21cb3e69e01008a8151b95fe32ffee30610 (patch)
tree55b983c2f697e51529962c32877b5652c7db3bf5 /drivers/soc
parentsoc/tegra: pmc: Fail to allocate more than one wake IRQ (diff)
downloadkernel-qcow2-linux-03b3c21cb3e69e01008a8151b95fe32ffee30610.tar.gz
kernel-qcow2-linux-03b3c21cb3e69e01008a8151b95fe32ffee30610.tar.xz
kernel-qcow2-linux-03b3c21cb3e69e01008a8151b95fe32ffee30610.zip
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')
-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;