Skip to contentSkip to conversation

soc/tegra: Fix wrong pointer passed to PTR_ERR()

PATCH In review Wei Yongjun 2 participants 2 messages Apr 16, 2017 – Apr 24, 2017 1 message not in the archive Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc/tegra: Fix wrong pointer passed to PTR_ERR()

From: Wei Yongjun <[email protected]>

PTR_ERR should access the value just tested by IS_ERR, otherwise the wrong error code will be returned.

Fixes 841fd94c43a4 ("soc/tegra: flowctrl: Add basic platform driver")
---
 drivers/soc/tegra/flowctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/tegra/flowctrl.c +1 -1
index 0e345c0..5433cc7 100644
@@ -157,7 +157,7 @@ static int tegra_flowctrl_probe(struct platform_device *pdev)
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	tegra_flowctrl_base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(tegra_flowctrl_base))
-		return PTR_ERR(base);
+		return PTR_ERR(tegra_flowctrl_base);
 
 	iounmap(base);
#2 lore raw
In reply to a message not in the archive
Quoted 16 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

PTR_ERR should access the value just tested by IS_ERR, otherwise the wrong error code will be returned.

Fixes 841fd94c43a4 ("soc/tegra: flowctrl: Add basic platform driver")
---
 drivers/soc/tegra/flowctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/tegra/flowctrl.c +0 -0
index 0e345c0..5433cc7 100644

drivers/soc/tegra/flowctrl.c static int tegra_flowctrl_probe(struct platform_device *pdev) · line 162

Quoted 7 lines
drivers/soc/tegra/flowctrl.c +1 -1
@@ -157,7 +157,7 @@ static int tegra_flowctrl_probe(struct platform_device *pdev)
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	tegra_flowctrl_base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(tegra_flowctrl_base))
-		return PTR_ERR(base);
+		return PTR_ERR(tegra_flowctrl_base);
 
 	iounmap(base);

Thanks. However, we have already received a fix for this here [0].

Jon

[0] https://patchwork.ozlabs.org/patch/749329/

Signature · 1 line
nvpublic