Files
Junjie Cao 08c0b56182 Input: ti_am335x_tsc - fix off-by-one error in wire_order validation
commit 248d3a73a0 upstream.

The current validation 'wire_order[i] > ARRAY_SIZE(config_pins)' allows
wire_order[i] to equal ARRAY_SIZE(config_pins), which causes out-of-bounds
access when used as index in 'config_pins[wire_order[i]]'.

Since config_pins has 4 elements (indices 0-3), the valid range for
wire_order should be 0-3. Fix the off-by-one error by using >= instead
of > in the validation check.

Signed-off-by: Junjie Cao <junjie.cao@intel.com>
Link: https://patch.msgid.link/20251114062817.852698-1-junjie.cao@intel.com
Fixes: bb76dc09dd ("input: ti_am33x_tsc: Order of TSC wires, made configurable")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-11 15:18:46 +01:00
..
2020-12-02 22:10:33 -08:00
2020-12-02 22:10:33 -08:00
2020-12-02 22:10:33 -08:00
2022-09-29 16:25:42 -07:00
2020-12-02 22:10:33 -08:00
2022-03-20 22:00:12 -07:00
2021-09-06 23:33:26 -07:00
2022-08-16 12:46:26 +02:00
2020-12-02 22:10:33 -08:00