summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarshana Padmadas <darshanapadmadas@gmail.com>2014-09-20 18:30:19 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-22 07:58:47 -0700
commit5b12d0ac20dd9084995d10e1ec5bd43b7ec90f41 (patch)
tree499ef4d86676bdcdacf7a1c596f5185e3fcf886e
parent8deab4754c478149f8a139d6f54dc8b3ff665724 (diff)
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>
-rw-r--r--drivers/staging/iio/adc/mxs-lradc.c2
1 files changed, 1 insertions, 1 deletions
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;