summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pinctrl/qcom/pinctrl-spmi-gpio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index e01a556ac586..cb512c7a5251 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -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;