Commit 4250c90b authored by Robin van der Gracht's avatar Robin van der Gracht Committed by Jonathan Cameron

iio: st_sensors: Fix buffer copy

Use byte_for_channel as iterator to properly initialize the buffer.
Signed-off-by: default avatarRobin van der Gracht <robin@protonic.nl>
Acked-by: default avatarDenis Ciocca <denis.ciocca@st.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Cc: <Stable@vger.kernel.org>
parent 6822ee34
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment