From: Wei Yongjun Date: Mon, 1 Nov 2021 14:02:35 +0000 (+0000) Subject: i2c: xgene-slimpro: Fix wrong pointer passed to PTR_ERR() X-Git-Tag: v6.1-rc5~2706^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c80be257a4cd0f72c083e6056ff0ce2da871e9dc;p=platform%2Fkernel%2Flinux-starfive.git 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") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Reviewed-by: Sudeep Holla Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-xgene-slimpro.c b/drivers/i2c/busses/i2c-xgene-slimpro.c index 1a19eba..63259b3 100644 --- a/drivers/i2c/busses/i2c-xgene-slimpro.c +++ b/drivers/i2c/busses/i2c-xgene-slimpro.c @@ -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;