diff options
| author | Michael Walle <[email protected]> | 2023-03-10 09:48:45 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2023-03-10 09:55:49 +0000 |
| commit | 06be62083c5308c76a891ca975d66d832e2afc07 (patch) | |
| tree | 90b9cc5e4c5bcaee9478473c51c83dcb98c79edd /fs/proc/array.c | |
| parent | firmware: xilinx: don't make a sleepable memory allocation from an atomic con... (diff) | |
| download | kernel-06be62083c5308c76a891ca975d66d832e2afc07.tar.gz kernel-06be62083c5308c76a891ca975d66d832e2afc07.zip | |
nvmem: core: return -ENOENT if nvmem cell is not found
Prior to commit 5d8e6e6c10a3 ("nvmem: core: add an index parameter to
the cell") of_nvmem_cell_get() would return -ENOENT if the cell wasn't
found. Particularly, if of_property_match_string() returned -EINVAL,
that return code was passed as the index to of_parse_phandle(), which
then detected it as invalid and returned NULL. That led to an return
code of -ENOENT.
With the new code, the negative index will lead to an -EINVAL of
of_parse_phandle_with_optional_args() which pass straight to the
caller and break those who expect an -ENOENT.
Fix it by always returning -ENOENT.
Fixes: 5d8e6e6c10a3 ("nvmem: core: add an index parameter to the cell")
Reported-by: Alexander Stein <[email protected]>
Link: https://lore.kernel.org/r/2143916.GUh0CODmnK@steina-w/
Signed-off-by: Michael Walle <[email protected]>
Tested-by: Alexander Stein <[email protected]>
Signed-off-by: Srinivas Kandagatla <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'fs/proc/array.c')
0 files changed, 0 insertions, 0 deletions
