iio:adc:ti-ads124s08: Fix buffer being too long.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 20 Sep 2020 11:27:41 +0000 (12:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:51:45 +0000 (11:51 +0100)
commit2d7229c037d155ff5b91d085b02c50f812c6efff
tree017c4d8a8eef63dfb8eae6a52cb5b355ccaca73d
parentd6ea1d559027dc8797db4152beb2ecc15e348bbe
iio:adc:ti-ads124s08: Fix buffer being too long.

commit b0bd27f02d768e3a861c4e6c27f8e369720e6c25 upstream.

The buffer is expressed as a u32 array, yet the extra space for
the s64 timestamp was expressed as sizeof(s64)/sizeof(u16).
This will result in 2 extra u32 elements.
Fix by dividing by sizeof(u32).

Fixes: e717f8c6dfec ("iio: adc: Add the TI ads124s08 ADC code")
Signed-off-by: Jonathan Cameron<Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200920112742.170751-8-jic23@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/ti-ads124s08.c