mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
qcom: spmi-gpio: Fix boundary conditions IRQ domain translate
GPIOs on the SPMI PMIC are numbered 1..ngpio, so the boundary check in
pmic_gpio_domain_translate() is off by one, correct this.
Fixes: ca69e2d165 ("qcom: spmi-gpio: add support for hierarchical IRQ chip")
Signed-off-by: Bjorn Andersson <[email protected]>
Reviewed-by: Brian Masney <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
a44aec0b4a
commit
dac7da986b
1 changed files with 2 additions and 1 deletions
|
|
@ -962,7 +962,8 @@ static int pmic_gpio_domain_translate(struct irq_domain *domain,
|
|||
struct pmic_gpio_state,
|
||||
chip);
|
||||
|
||||
if (fwspec->param_count != 2 || fwspec->param[0] >= state->chip.ngpio)
|
||||
if (fwspec->param_count != 2 ||
|
||||
fwspec->param[0] < 1 || fwspec->param[0] > state->chip.ngpio)
|
||||
return -EINVAL;
|
||||
|
||||
*hwirq = fwspec->param[0] - PMIC_GPIO_PHYSICAL_OFFSET;
|
||||
|
|
|
|||
Loading…
Reference in a new issue