Commit 5b12d0ac authored by Darshana Padmadas's avatar Darshana Padmadas Committed by Greg Kroah-Hartman

Staging: iio: adc: Fix warning prefer kmalloc_array over kmalloc

This patch fixes the checkpatch warning:
WARNING: Prefer kmalloc_array over kmalloc with multiply

kmalloc_array is preffered for allocating for arrays.
Signed-off-by: default avatarDarshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8deab475
...@@ -1280,7 +1280,7 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio) ...@@ -1280,7 +1280,7 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
if (!ret) if (!ret)
return -EBUSY; return -EBUSY;
lradc->buffer = kmalloc(len * sizeof(*lradc->buffer), GFP_KERNEL); lradc->buffer = kmalloc_array(len, sizeof(*lradc->buffer), GFP_KERNEL);
if (!lradc->buffer) { if (!lradc->buffer) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_mem; goto err_mem;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment