Skip to contentSkip to conversation

i2c: xgene-slimpro: Fix wrong pointer passed to PTR_ERR()

PATCH Applied Wei Yongjun 3 participants 3 messages Nov 1, 2021 – Nov 6, 2021

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

PATCH 1/1 i2c: xgene-slimpro: Fix wrong pointer passed to PTR_ERR()

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

Fixes 7b6da7fe7bba ("mailbox: pcc: Use PCC mailbox channel pointer instead of standard")
---
 drivers/i2c/busses/i2c-xgene-slimpro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-xgene-slimpro.c +1 -1
index 1a19ebad60ad..63259b3ea5ab 100644
@@ -487,7 +487,7 @@ static int xgene_slimpro_i2c_probe(struct platform_device *pdev)
 		pcc_chan = pcc_mbox_request_channel(cl, ctx->mbox_idx);
 		if (IS_ERR(pcc_chan)) {
 			dev_err(&pdev->dev, "PCC mailbox channel request failed\n");
-			return PTR_ERR(ctx->pcc_chan);
+			return PTR_ERR(pcc_chan);
 		}
 
 		ctx->pcc_chan = pcc_chan;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Wei Yongjun

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

Fixes 7b6da7fe7bba ("mailbox: pcc: Use PCC mailbox channel pointer instead of standard")

Thanks for spotting and fixing the issue.

Signature · 2 lines
Regards,
Sudeep