iio: st_sensors: Fix buffer copy
PATCH 1/1 iio: st_sensors: Fix buffer copy
Use byte_for_channel as iterator to properly initialize the buffer.
--- drivers/iio/common/st_sensors/st_sensors_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/common/st_sensors/st_sensors_buffer.c +1 -1
@@ -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
Signature · 1 line
1.9.1
Thanks!
Denis
Quoted 20 lines · Robin van der Gracht
Use
byte_for_channelas iterator to properly initialize the buffer.Signed-off-by Robin van der Gracht <[email protected]>--- drivers/iio/common/st_sensors/st_sensors_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/common/st_sensors/st_sensors_buffer.c +1
-1@@ -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
Quoted 1 line · Denis CIOCCA
Acked-by Denis Ciocca <[email protected]>
Applied to fixes-togreg branch of iio.git and marked for stable.
Note that given the timing this will probably not hit mainline until after the coming merge window. Only after that will it get picked up for stable.
Jonathan
Quoted 31 lines
Thanks!
Denis
Quoted 12 lines · Robin van der Gracht
Use
byte_for_channelas iterator to properly initialize the buffer.Signed-off-by Robin van der Gracht <[email protected]>--- drivers/iio/common/st_sensors/st_sensors_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/common/st_sensors/st_sensors_buffer.c +0
-0drivers/iio/common/st_sensors/st_sensors_buffer.c int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf) · line 77
Quoted 8 lines
drivers/iio/common/st_sensors/st_sensors_buffer.c +1
-1@@ -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 --
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html