WSL2-Linux-Kernel/drivers/nvmem
Michael Walle 06be62083c nvmem: core: return -ENOENT if nvmem cell is not found
Prior to commit 5d8e6e6c10 ("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: 5d8e6e6c10 ("nvmem: core: add an index parameter to the cell")
Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/2143916.GUh0CODmnK@steina-w/
Signed-off-by: Michael Walle <michael@walle.cc>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230310094845.139400-1-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-10 10:55:49 +01:00
..
Kconfig nvmem: stm32: fix OPTEE dependency 2023-02-06 19:07:00 +01:00
Makefile nvmem: stm32: add OP-TEE support for STM32MP13x 2023-02-06 19:06:59 +01:00
apple-efuses.c
bcm-ocotp.c
brcm_nvram.c nvmem: brcm_nvram: Add check for kzalloc 2023-01-28 14:36:28 +01:00
core.c nvmem: core: return -ENOENT if nvmem cell is not found 2023-03-10 10:55:49 +01:00
imx-iim.c
imx-ocotp-scu.c
imx-ocotp.c nvmem: core: add an index parameter to the cell 2023-02-06 19:06:59 +01:00
jz4780-efuse.c
lan9662-otpc.c
layerscape-sfp.c
lpc18xx_eeprom.c
lpc18xx_otp.c
meson-efuse.c
meson-mx-efuse.c
microchip-otpc.c
mtk-efuse.c
mxs-ocotp.c
nintendo-otp.c
qcom-spmi-sdam.c nvmem: qcom-spmi-sdam: register at device init time 2023-02-06 19:06:59 +01:00
qfprom.c
rave-sp-eeprom.c nvmem: rave-sp-eeprm: fix kernel-doc bad line warning 2023-02-06 19:06:59 +01:00
rmem.c
rockchip-efuse.c
rockchip-otp.c
sc27xx-efuse.c
snvs_lpgpr.c
sprd-efuse.c
stm32-bsec-optee-ta.c nvmem: stm32: add OP-TEE support for STM32MP13x 2023-02-06 19:06:59 +01:00
stm32-bsec-optee-ta.h nvmem: stm32: add OP-TEE support for STM32MP13x 2023-02-06 19:06:59 +01:00
stm32-romem.c nvmem: stm32: detect bsec pta presence for STM32MP15x 2023-02-06 19:06:59 +01:00
sunplus-ocotp.c
sunxi_sid.c nvmem: sunxi_sid: Drop the workaround on A64 2023-02-06 19:06:58 +01:00
u-boot-env.c
uniphier-efuse.c
vf610-ocotp.c
zynqmp_nvmem.c