mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 15:42:46 +00:00
iio: adc: intel_mrfld_adc: Allocating too much data in probe()
This probe function is passing the wrong size to devm_iio_device_alloc().
It is supposed to be the size of the private data. Fortunately,
sizeof(*indio_dev) is larger than sizeof(struct mrfld_adc) so it doesn't
cause a runtime problem.
Fixes: a711866273
("iio: adc: intel_mrfld_adc: Add Basin Cove ADC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
11d7c8d3b1
commit
1f310f77ef
1 changed files with 1 additions and 1 deletions
|
@ -185,7 +185,7 @@ static int mrfld_adc_probe(struct platform_device *pdev)
|
|||
int irq;
|
||||
int ret;
|
||||
|
||||
indio_dev = devm_iio_device_alloc(dev, sizeof(*indio_dev));
|
||||
indio_dev = devm_iio_device_alloc(dev, sizeof(struct mrfld_adc));
|
||||
if (!indio_dev)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
Loading…
Reference in a new issue