mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-19 16:31:27 +01:00
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 <andrew.goodbody@linaro.org> Link: https://lore.kernel.org/r/20250807-pinctrl_qcom-v1-2-42fac6707fd5@linaro.org Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
This commit is contained in:
parent
be12b6e158
commit
d9fbc1d70b
@ -72,7 +72,7 @@ static const char *sdm845_get_pin_name(struct udevice *dev,
|
|||||||
"sdc2_data",
|
"sdc2_data",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (selector >= 150 && selector <= 154)
|
if (selector >= 150 && selector <= 153)
|
||||||
snprintf(pin_name, MAX_PIN_NAME_LEN, special_pins_names[selector - 150]);
|
snprintf(pin_name, MAX_PIN_NAME_LEN, special_pins_names[selector - 150]);
|
||||||
else
|
else
|
||||||
snprintf(pin_name, MAX_PIN_NAME_LEN, "gpio%u", selector);
|
snprintf(pin_name, MAX_PIN_NAME_LEN, "gpio%u", selector);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user