From: Thierry Reding Date: Mon, 27 May 2019 10:19:23 +0000 (+0200) Subject: soc/tegra: pmc: Avoid crash for non-wake IRQs X-Git-Tag: v5.15~5871^2~5^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03b3c21cb3e69e01008a8151b95fe32ffee30610;p=platform%2Fkernel%2Flinux-starfive.git 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 Reviewed-by: Jon Hunter Signed-off-by: Thierry Reding --- diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 653fe2c..6e66b5e 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;