aboutsummaryrefslogtreecommitdiff
path: root/lib/test-string_helpers.c
diff options
context:
space:
mode:
authorKees Cook <[email protected]>2022-01-12 12:34:56 -0800
committerJonathan Cameron <[email protected]>2022-01-30 14:19:20 +0000
commite7a3290d330e3f8cf06a3cad455c49e89183137b (patch)
treea5d47a385b23368477d6863eebf14f65f2efe7f4 /lib/test-string_helpers.c
parente0a2e37f303828d030a83f33ffe14b36cb88d563 (diff)
iio: addac: ad74413r: Do not reference negative array offsets
Instead of aiming rx_buf at an invalid array-boundary-crossing location, just skip the first increment. Seen when building with -Warray-bounds: drivers/iio/addac/ad74413r.c: In function 'ad74413r_update_scan_mode': drivers/iio/addac/ad74413r.c:843:22: warning: array subscript -4 is below array bounds of 'u8[16]' { aka 'unsigned char[16]'} [-Warray-bounds] 843 | u8 *rx_buf = &st->adc_samples_buf.rx_buf[-1 * AD74413R_FRAME_SIZE]; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/iio/addac/ad74413r.c:84:20: note: while referencing 'rx_buf' 84 | u8 rx_buf[AD74413R_FRAME_SIZE * AD74413R_CHANNEL_MAX]; | ^~~~~~ Cc: Lars-Peter Clausen <[email protected]> Cc: Michael Hennerich <[email protected]> Cc: Jonathan Cameron <[email protected]> Cc: [email protected] Fixes: fea251b6a5db ("iio: addac: add AD74413R driver") Reviewed-by: Cosmin Tanislav <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
Diffstat (limited to 'lib/test-string_helpers.c')
0 files changed, 0 insertions, 0 deletions