diff options
author | Kees Cook <[email protected]> | 2023-01-27 16:53:58 -0800 |
---|---|---|
committer | Mark Brown <[email protected]> | 2023-01-28 17:19:11 +0000 |
commit | e314e15a0b58f9d051c00b25951073bcdae61953 (patch) | |
tree | a896b719dd0c7900d97f619e4603402384e000f1 /tools/testing/selftests/bpf/progs/test_access_variable_array.c | |
parent | 4fd8bcec5fd7c0d586206fa2f42bd67b06cdaa7e (diff) |
regulator: s5m8767: Bounds check id indexing into arrays
The compiler has no way to know if "id" is within the array bounds of
the regulators array. Add a check for this and a build-time check that
the regulators and reg_voltage_map arrays are sized the same. Seen with
GCC 13:
../drivers/regulator/s5m8767.c: In function 's5m8767_pmic_probe':
../drivers/regulator/s5m8767.c:936:35: warning: array subscript [0, 36] is outside array bounds of 'struct regulator_desc[37]' [-Warray-bounds=]
936 | regulators[id].vsel_reg =
| ~~~~~~~~~~^~~~
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: [email protected]
Signed-off-by: Kees Cook <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_access_variable_array.c')
0 files changed, 0 insertions, 0 deletions