OSDN Git Service

iio: adc: ads124: avoid buffer overflow
authorVincent Stehlé <vincent.stehle@laposte.net>
Sun, 31 Mar 2019 18:54:23 +0000 (20:54 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 7 Apr 2019 12:01:36 +0000 (13:01 +0100)
commit0db8aa49a97e7f40852a64fd35abcc1292a7c365
treee37d55a046340917a6fa881aae0a846eff201663
parent4e63ed6b90803eeb400c392e9ff493200d926b06
iio: adc: ads124: avoid buffer overflow

When initializing the priv->data array starting from index 1, there is one
less element to consider than when initializing the full array.

Fixes: e717f8c6dfec8f76 ("iio: adc: Add the TI ads124s08 ADC code")
Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Reviewed-by: Dan Murphy <dmurphy@ti.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ti-ads124s08.c