diff options
| author | Junjie Cao <junjie.cao@intel.com> | 2025-12-18 21:56:59 -0800 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2025-12-18 22:00:07 -0800 |
| commit | 248d3a73a0167dce15ba100477c3e778c4787178 (patch) | |
| tree | a60d793d212257d1fcdae26192f92421d6e105bd /lib/trace_readwrite.c | |
| parent | 806ec7b797adc1cc9b11535307638a55ddfb873c (diff) | |
Input: ti_am335x_tsc - fix off-by-one error in wire_order validation
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: bb76dc09ddfc ("input: ti_am33x_tsc: Order of TSC wires, made configurable")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'lib/trace_readwrite.c')
0 files changed, 0 insertions, 0 deletions
