summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoniu Miclaus <antoniu.miclaus@analog.com>2026-02-11 20:10:05 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2026-02-23 11:24:22 +0300
commit25ac1dea217f328ea71f8f09bfb290534de3cbce (patch)
tree006fe21742f12cef6c9125f8ee60b284907b6306
parent8e901c49ffc8d59adabae4020724f96770d35db7 (diff)
downloadlinux-25ac1dea217f328ea71f8f09bfb290534de3cbce.tar.xz
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>
-rw-r--r--drivers/iio/adc/pac1934.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/pac1934.c b/drivers/iio/adc/pac1934.c
index 712b5e9caba6..23055405a6e0 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;