mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
staging:iio:accel:adis16201 overflow tx buffer.
Smatch caught bug. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
0cbb2b53fb
commit
70a876c590
1 changed files with 6 additions and 4 deletions
|
|
@ -38,10 +38,12 @@ static int adis16201_read_ring_data(struct iio_dev *indio_dev, u8 *rx)
|
|||
xfers[i].cs_change = 1;
|
||||
xfers[i].len = 2;
|
||||
xfers[i].delay_usecs = 20;
|
||||
xfers[i].tx_buf = st->tx + 2 * i;
|
||||
st->tx[2 * i] = ADIS16201_READ_REG(ADIS16201_SUPPLY_OUT +
|
||||
2 * i);
|
||||
st->tx[2 * i + 1] = 0;
|
||||
if (i < ADIS16201_OUTPUTS) {
|
||||
xfers[i].tx_buf = st->tx + 2 * i;
|
||||
st->tx[2 * i] = ADIS16201_READ_REG(ADIS16201_SUPPLY_OUT +
|
||||
2 * i);
|
||||
st->tx[2 * i + 1] = 0;
|
||||
}
|
||||
if (i >= 1)
|
||||
xfers[i].rx_buf = rx + 2 * (i - 1);
|
||||
spi_message_add_tail(&xfers[i], &msg);
|
||||
|
|
|
|||
Loading…
Reference in a new issue