]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: frequency: adf4350: Return -ENOMEM on memory allocation failure
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Wed, 11 Feb 2026 17:10:06 +0000 (19:10 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 23 Feb 2026 08:24:22 +0000 (08:24 +0000)
adf4350_parse_dt() returns NULL only when devm_kzalloc() fails. The
caller should return -ENOMEM in this case, 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>
drivers/iio/frequency/adf4350.c

index ed1741165f5550425ecb1c794c9f019f39c9ca92..3883b63dcc3cefa1aaddf739fe5ca444eda2901b 100644 (file)
@@ -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);
        }