From 5b12d0ac20dd9084995d10e1ec5bd43b7ec90f41 Mon Sep 17 00:00:00 2001 From: Darshana Padmadas Date: Sat, 20 Sep 2014 18:30:19 +0530 Subject: [PATCH] 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/adc/mxs-lradc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c index 468327f4a753..75fcb72911f1 100644 --- a/drivers/staging/iio/adc/mxs-lradc.c +++ b/drivers/staging/iio/adc/mxs-lradc.c @@ -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; -- 2.20.1