[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260211171007.143527-1-antoniu.miclaus@analog.com>
Date: Wed, 11 Feb 2026 19:10:05 +0200
From: Antoniu Miclaus <antoniu.miclaus@...log.com>
To: Marius Cristea <marius.cristea@...rochip.com>,
Jonathan Cameron
<jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko
<andy@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich
<Michael.Hennerich@...log.com>,
<linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: Antoniu Miclaus <antoniu.miclaus@...log.com>
Subject: [PATCH] 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.
Fixes: 0fb528c8255b ("iio: adc: adding support for PAC193x")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@...log.com>
---
drivers/iio/adc/pac1934.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/pac1934.c b/drivers/iio/adc/pac1934.c
index ec96bb0f2ed6..b791ce23f3fd 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;
--
2.43.0
Powered by blists - more mailing lists