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: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Darshana Padmadas 2014-09-20 18:30:19 +05:30 committed by Greg Kroah-Hartman
parent 8deab4754c
commit 5b12d0ac20

View file

@ -1280,7 +1280,7 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
if (!ret)
return -EBUSY;
lradc->buffer = kmalloc(len * sizeof(*lradc->buffer), GFP_KERNEL);
lradc->buffer = kmalloc_array(len, sizeof(*lradc->buffer), GFP_KERNEL);
if (!lradc->buffer) {
ret = -ENOMEM;
goto err_mem;