diff options
author | Robin van der Gracht <robin@protonic.nl> | 2014-09-29 09:00:07 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-10-04 07:10:57 -0400 |
commit | 4250c90b30b8bf2a1a21122ba0484f8f351f152d (patch) | |
tree | f10737232131f942998305085d4d276c08ec47a6 /drivers/iio | |
parent | 6822ee34ad57b29a3b44df2c2829910f03c34fa4 (diff) |
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) | |||
71 | goto st_sensors_free_memory; | 71 | goto st_sensors_free_memory; |
72 | } | 72 | } |
73 | 73 | ||
74 | for (i = 0; i < n * num_data_channels; i++) { | 74 | for (i = 0; i < n * byte_for_channel; i++) { |
75 | if (i < n) | 75 | if (i < n) |
76 | buf[i] = rx_array[i]; | 76 | buf[i] = rx_array[i]; |
77 | else | 77 | else |