diff options
author | Robin van der Gracht <robin@protonic.nl> | 2014-09-29 17:00:07 +0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-11-05 21:33:43 +0300 |
commit | c6b4cac2d9cbe7891260b55b2871d269d89d1ae7 (patch) | |
tree | 7b9bfa73a755a68fea259b15e98a7a5eef99b76d /drivers/iio | |
parent | 97fb3033128958457f77456dc677a64bce8d33ae (diff) | |
download | linux-c6b4cac2d9cbe7891260b55b2871d269d89d1ae7.tar.xz |
iio: st_sensors: Fix buffer copy
Use byte_for_channel as iterator to properly initialize the buffer.
Signed-off-by: Robin van der Gracht <robin@protonic.nl>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: <Stable@vger.kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/common/st_sensors/st_sensors_buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/common/st_sensors/st_sensors_buffer.c b/drivers/iio/common/st_sensors/st_sensors_buffer.c index 1665c8e4b62b..e18bc6782256 100644 --- a/drivers/iio/common/st_sensors/st_sensors_buffer.c +++ b/drivers/iio/common/st_sensors/st_sensors_buffer.c @@ -71,7 +71,7 @@ int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf) goto st_sensors_free_memory; } - for (i = 0; i < n * num_data_channels; i++) { + for (i = 0; i < n * byte_for_channel; i++) { if (i < n) buf[i] = rx_array[i]; else |