spmi: pmic-arb: check apid against limits before calling irq handler
authorDavid Collins <collinsd@codeaurora.org>
Fri, 30 Sep 2022 00:50:14 +0000 (17:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Sep 2022 12:33:23 +0000 (14:33 +0200)
commit191adbdd26f1a26c9302369b2701bfddf8c0780e
tree558f782414aa13c21844946dcf2e79b52f239d78
parentb6c1761721193c52234e3ed048e4d16ab527bb74
spmi: pmic-arb: check apid against limits before calling irq handler

Check that the apid for an SPMI interrupt falls between the
min_apid and max_apid that can be handled by the APPS processor
before invoking the per-apid interrupt handler:
periph_interrupt().

This avoids an access violation in rare cases where the status
bit is set for an interrupt that is not owned by the APPS
processor.

Signed-off-by: David Collins <collinsd@codeaurora.org>
Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
Link: https://lore.kernel.org/r/1655004286-11493-5-git-send-email-quic_fenglinw@quicinc.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20220930005019.2663064-6-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spmi/spmi-pmic-arb.c