summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndrew Goodbody <[email protected]>2025-08-07 12:20:02 +0100
committerCasey Connolly <[email protected]>2025-08-13 15:18:49 +0200
commitd9fbc1d70bc9d5e7665c9fc1ed71d25e04faba54 (patch)
treec09d47867f2b50fa76e9143e22133923fc247c07 /drivers
parentbe12b6e158a06580437f2e4756eb6021cf0cbfbe (diff)
pinctrl: qcom: sdm845: Limit check off by 1
The driver specifies 154 pins so should have a maximum selector of 153 to ensure that the index into the array special_pins_names does not overflow. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pinctrl/qcom/pinctrl-sdm845.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/qcom/pinctrl-sdm845.c b/drivers/pinctrl/qcom/pinctrl-sdm845.c
index 3f55fc81c8e..24b42e94c7a 100644
--- a/drivers/pinctrl/qcom/pinctrl-sdm845.c
+++ b/drivers/pinctrl/qcom/pinctrl-sdm845.c
@@ -72,7 +72,7 @@ static const char *sdm845_get_pin_name(struct udevice *dev,
"sdc2_data",
};
- if (selector >= 150 && selector <= 154)
+ if (selector >= 150 && selector <= 153)
snprintf(pin_name, MAX_PIN_NAME_LEN, special_pins_names[selector - 150]);
else
snprintf(pin_name, MAX_PIN_NAME_LEN, "gpio%u", selector);