Skip to contentSkip to conversation

gpu: host1x: 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

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpu: host1x: 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 b386c6b73ac6 ("gpu: host1x: Support module reset")
---
 drivers/gpu/host1x/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/host1x/dev.c +1 -1
index f05ebb1..ac65f52 100644
@@ -172,7 +172,7 @@ static int host1x_probe(struct platform_device *pdev)
 
 	host->rst = devm_reset_control_get(&pdev->dev, "host1x");
 	if (IS_ERR(host->rst)) {
-		err = PTR_ERR(host->clk);
+		err = PTR_ERR(host->rst);
 		dev_err(&pdev->dev, "failed to get reset: %d\n", err);
 		return err;
 	}

A message that is not in the archive (sent off-list or not yet received): 20170416040810.10476-1-weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw
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 b386c6b73ac6 ("gpu: host1x: Support module reset")
---
 drivers/gpu/host1x/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/host1x/dev.c +0 -0
index f05ebb1..ac65f52 100644

drivers/gpu/host1x/dev.c static int host1x_probe(struct platform_device *pdev) · line 178

Quoted 8 lines
drivers/gpu/host1x/dev.c +1 -1
@@ -172,7 +172,7 @@ static int host1x_probe(struct platform_device *pdev)
 
 	host->rst = devm_reset_control_get(&pdev->dev, "host1x");
 	if (IS_ERR(host->rst)) {
-		err = PTR_ERR(host->clk);
+		err = PTR_ERR(host->rst);
 		dev_err(&pdev->dev, "failed to get reset: %d\n", err);
 		return err;
 	}

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

Cheers
Jon

[0] https://patchwork.kernel.org/patch/9674417/

Signature · 1 line
nvpublic