Commit c80be257 authored by Wei Yongjun's avatar Wei Yongjun Committed by Wolfram Sang
Browse files

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: 7b6da7fe ("mailbox: pcc: Use PCC mailbox channel pointer instead of standard")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent fe91c472
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;