mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iio: frequency: adf4350: Return -ENOMEM on memory allocation failure
@ 2026-02-11 17:10 Antoniu Miclaus
  2026-02-11 17:39 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Antoniu Miclaus @ 2026-02-11 17:10 UTC (permalink / raw)
  To: Marius Cristea, Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, Lars-Peter Clausen, Michael Hennerich,
	linux-iio, linux-kernel
  Cc: Antoniu Miclaus

adf4350_parse_dt() returns NULL only when devm_kzalloc() fails. The
caller should return -ENOMEM in this case, not -EINVAL.

Fixes: e764df679639 ("iio: frequency: adf4350: Add support for dt bindings")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
 drivers/iio/frequency/adf4350.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
index ed1741165f55..3883b63dcc3c 100644
--- a/drivers/iio/frequency/adf4350.c
+++ b/drivers/iio/frequency/adf4350.c
@@ -607,7 +607,7 @@ static int adf4350_probe(struct spi_device *spi)
 	if (dev_fwnode(&spi->dev)) {
 		pdata = adf4350_parse_dt(&spi->dev);
 		if (pdata == NULL)
-			return -EINVAL;
+			return -ENOMEM;
 	} else {
 		pdata = dev_get_platdata(&spi->dev);
 	}
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-14 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-11 17:10 [PATCH] iio: frequency: adf4350: Return -ENOMEM on memory allocation failure Antoniu Miclaus
2026-02-11 17:39 ` Andy Shevchenko
2026-02-14 19:36   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®