Skip to contentSkip to conversation

soc: mediatek: mtk-svs: fix passing zero to 'PTR_ERR'

PATCH Applied Roger Lu 2 participants 2 messages Feb 16, 2023 – Mar 30, 2023 Arm MediaTek

lore
Share & tools
lore

Roger Lu

author
#0 lore raw

nvmem_cell_get() cannot return NULL so checking for NULL is wrong here.

Fixes 6c7174fd90a4690 ("soc: mediatek: mtk-svs: use svs get efuse common function")
---
 drivers/soc/mediatek/mtk-svs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/mediatek/mtk-svs.c +1 -1
index a7eb019b5157..8127fb6d587b 100644
@@ -1726,7 +1726,7 @@ static int svs_get_efuse_data(struct svs_platform *svsp,
 	struct nvmem_cell *cell;
 
 	cell = nvmem_cell_get(svsp->dev, nvmem_cell_name);
-	if (IS_ERR_OR_NULL(cell)) {
+	if (IS_ERR(cell)) {
 		dev_err(svsp->dev, "no \"%s\"? %ld\n",
 			nvmem_cell_name, PTR_ERR(cell));
 		return PTR_ERR(cell);
Signature · 1 line
2.18.0
maintainer Applied
#1 lore raw
Quoted 7 lines · Roger Lu

nvmem_cell_get() cannot return NULL so checking for NULL is wrong here.

Fixes 6c7174fd90a4690 ("soc: mediatek: mtk-svs: use svs get efuse common function")

Applied, thanks.

Quoted 17 lines
---
  drivers/soc/mediatek/mtk-svs.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/mediatek/mtk-svs.c +1 -1
index a7eb019b5157..8127fb6d587b 100644
@@ -1726,7 +1726,7 @@ static int svs_get_efuse_data(struct svs_platform *svsp,
  	struct nvmem_cell *cell;
 
  	cell = nvmem_cell_get(svsp->dev, nvmem_cell_name);
-	if (IS_ERR_OR_NULL(cell)) {
+	if (IS_ERR(cell)) {
  		dev_err(svsp->dev, "no \"%s\"? %ld\n",
  			nvmem_cell_name, PTR_ERR(cell));
  		return PTR_ERR(cell);