From: Antoniu Miclaus Date: Wed, 11 Feb 2026 17:10:05 +0000 (+0200) Subject: iio: adc: pac1934: Return -ENOMEM on memory allocation failure X-Git-Tag: v7.1-rc1~17^2~120^2~207 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=25ac1dea217f328ea71f8f09bfb290534de3cbce;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Andy Shevchenko Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/adc/pac1934.c b/drivers/iio/adc/pac1934.c index 712b5e9caba6d..23055405a6e0c 100644 --- a/drivers/iio/adc/pac1934.c +++ b/drivers/iio/adc/pac1934.c @@ -1351,7 +1351,7 @@ static int pac1934_prep_iio_channels(struct pac1934_chip_info *info, struct iio_ dyn_ch_struct = devm_kzalloc(dev, channel_size, GFP_KERNEL); if (!dyn_ch_struct) - return -EINVAL; + return -ENOMEM; tmp_data = dyn_ch_struct;