pinctrl: qcom: sa8775: Limit check for array index not correct
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Thu, 7 Aug 2025 11:20:01 +0000 (12:20 +0100)
committerCasey Connolly <casey.connolly@linaro.org>
Wed, 13 Aug 2025 13:18:49 +0000 (15:18 +0200)
commitbe12b6e158a06580437f2e4756eb6021cf0cbfbe
treeda7891c9be37a6806945392e87bc04f1f4a94c3d
parent8a0bb0b176069989d645e1edca2737d46770a530
pinctrl: qcom: sa8775: Limit check for array index not correct

In sa8775p_get_pin_name the limit check for the index into
msm_special_pins_data allows for more elements than exist. Add code to
ensure the array index remains in bounds.

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-1-42fac6707fd5@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
drivers/pinctrl/qcom/pinctrl-sa8775p.c