Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: pac1934: Return -ENOMEM on memory allocation failure

devm_kzalloc() returns NULL on allocation failure. The appropriate error
code for this condition is -ENOMEM, not -EINVAL.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Antoniu Miclaus and committed by
Jonathan Cameron
25ac1dea 8e901c49

+1 -1
+1 -1
drivers/iio/adc/pac1934.c
··· 1351 1351 1352 1352 dyn_ch_struct = devm_kzalloc(dev, channel_size, GFP_KERNEL); 1353 1353 if (!dyn_ch_struct) 1354 - return -EINVAL; 1354 + return -ENOMEM; 1355 1355 1356 1356 tmp_data = dyn_ch_struct; 1357 1357