From: Darshana Padmadas Date: Sat, 20 Sep 2014 13:00:19 +0000 (+0530) Subject: Staging: iio: adc: Fix warning prefer kmalloc_array over kmalloc X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5b12d0ac20dd9084995d10e1ec5bd43b7ec90f41;p=openwrt%2Fstaging%2Fblogic.git 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 --- 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;