i2c: xgene-slimpro: Fix wrong pointer passed to PTR_ERR()
Subsystems (2)
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")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Wei Yongjun <[email protected]>
--- drivers/i2c/busses/i2c-xgene-slimpro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-xgene-slimpro.c +1 -1
@@ -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;
Quoted 5 lines · Wei Yongjun
PTR_ERRshould access the value just tested byIS_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 <[email protected]>
Thanks for spotting and fixing the issue.
Reviewed-by Sudeep Holla <[email protected]>
Signature · 2 lines
Regards, Sudeep
Wolfram Sang
AppliedQuoted 6 lines · Wei Yongjun
PTR_ERRshould access the value just tested byIS_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 <[email protected]>Signed-off-by Wei Yongjun <[email protected]>
Applied to for-current, thanks!