diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c index 468327f4a7533590f1ffed2ffa2f73bd7870592f..75fcb72911f168892b3bcdef0ab486ae25146de0 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;