Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: ad_sigma_delta: don't overallocate scan buffer

Fix overallocating the size of the scan buffer by converting bits to
bytes. The size is meant to be in bytes, so scanbits needs to be
divided by 8.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20250701-iio-adc-ad7173-add-spi-offload-support-v3-1-42abb83e3dac@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
5a2f15c5 7bf7b62e

+1 -1
+1 -1
drivers/iio/adc/ad_sigma_delta.c
··· 489 489 return ret; 490 490 } 491 491 492 - samples_buf_size = ALIGN(slot * indio_dev->channels[0].scan_type.storagebits, 8); 492 + samples_buf_size = ALIGN(slot * indio_dev->channels[0].scan_type.storagebits / 8, 8); 493 493 samples_buf_size += sizeof(int64_t); 494 494 samples_buf = devm_krealloc(&sigma_delta->spi->dev, sigma_delta->samples_buf, 495 495 samples_buf_size, GFP_KERNEL);