1
0
Fork 0

iio: adc: ti_am335x_adc: allocating too much in probe

We should be allocating enough information for a tiadc_device struct
which is about 400 bytes but instead we allocate enough for a second
iio_dev struct which is over 2000 bytes.

Fixes: fea89e2dfc ("iio: adc: ti_am335x_adc: use variable names for sizeof() operator")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
zero-colors
Dan Carpenter 2017-05-10 08:51:09 +03:00 committed by Jonathan Cameron
parent f35327f16b
commit 5ba5b437ef
1 changed files with 1 additions and 1 deletions

View File

@ -614,7 +614,7 @@ static int tiadc_probe(struct platform_device *pdev)
return -EINVAL;
}
indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*indio_dev));
indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*adc_dev));
if (indio_dev == NULL) {
dev_err(&pdev->dev, "failed to allocate iio device\n");
return -ENOMEM;