diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-05-10 01:51:09 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2017-05-14 11:21:13 -0400 |
commit | 5ba5b437efaa7a502eec393c045d3bf90c92c4e9 (patch) | |
tree | 9b2933790f45658ca416fbc35630257c71d5fb18 | |
parent | f35327f16b0cbe51d47a366aaf5dd9a3d4fac01b (diff) |
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: fea89e2dfcea ("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>
-rw-r--r-- | drivers/iio/adc/ti_am335x_adc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index 4282ceca3d8f..6cbed7eb118a 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c | |||
@@ -614,7 +614,7 @@ static int tiadc_probe(struct platform_device *pdev) | |||
614 | return -EINVAL; | 614 | return -EINVAL; |
615 | } | 615 | } |
616 | 616 | ||
617 | indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*indio_dev)); | 617 | indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*adc_dev)); |
618 | if (indio_dev == NULL) { | 618 | if (indio_dev == NULL) { |
619 | dev_err(&pdev->dev, "failed to allocate iio device\n"); | 619 | dev_err(&pdev->dev, "failed to allocate iio device\n"); |
620 | return -ENOMEM; | 620 | return -ENOMEM; |