mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-02-01 16:44:26 +00:00
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:
parent
8deab4754c
commit
5b12d0ac20
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user