mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-27 20:22:02 -04:00
iio: frequency: adf4350: Return -ENOMEM on memory allocation failure
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>
This commit is contained in:
committed by
Jonathan Cameron
parent
25ac1dea21
commit
bc2cb23607
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user