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: 7b6da7fe7b ("mailbox: pcc: Use PCC mailbox channel pointer instead of standard")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
This commit is contained in:
Wei Yongjun 2021-11-01 14:02:35 +00:00 committed by Wolfram Sang
parent fe91c4725a
commit c80be257a4

View File

@ -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;