kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] i2c: xgene-slimpro: Fix wrong pointer passed to PTR_ERR()
@ 2021-11-01 14:02 Wei Yongjun
  2021-11-01 17:11 ` Sudeep Holla
  2021-11-06 21:28 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2021-11-01 14:02 UTC (permalink / raw)
  To: weiyongjun1, Wolfram Sang, Jassi Brar, Tian Tao, Zhiqi Song,
	Florian Fainelli, Sudeep Holla
  Cc: linux-i2c, kernel-janitors, Hulk Robot

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 <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/i2c/busses/i2c-xgene-slimpro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-xgene-slimpro.c b/drivers/i2c/busses/i2c-xgene-slimpro.c
index 1a19ebad60ad..63259b3ea5ab 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;


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] i2c: xgene-slimpro: Fix wrong pointer passed to PTR_ERR()
  2021-11-01 14:02 [PATCH -next] i2c: xgene-slimpro: Fix wrong pointer passed to PTR_ERR() Wei Yongjun
@ 2021-11-01 17:11 ` Sudeep Holla
  2021-11-06 21:28 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Sudeep Holla @ 2021-11-01 17:11 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Wolfram Sang, Jassi Brar, Tian Tao, Zhiqi Song, Sudeep Holla,
	Florian Fainelli, linux-i2c, kernel-janitors, Hulk Robot

On Mon, Nov 01, 2021 at 02:02:35PM +0000, Wei Yongjun wrote:
> 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 <hulkci@huawei.com>

Thanks for spotting and fixing the issue.

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] i2c: xgene-slimpro: Fix wrong pointer passed to PTR_ERR()
  2021-11-01 14:02 [PATCH -next] i2c: xgene-slimpro: Fix wrong pointer passed to PTR_ERR() Wei Yongjun
  2021-11-01 17:11 ` Sudeep Holla
@ 2021-11-06 21:28 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2021-11-06 21:28 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Jassi Brar, Tian Tao, Zhiqi Song, Florian Fainelli, Sudeep Holla,
	linux-i2c, kernel-janitors, Hulk Robot

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

On Mon, Nov 01, 2021 at 02:02:35PM +0000, Wei Yongjun wrote:
> 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 <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-06 21:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-01 14:02 [PATCH -next] i2c: xgene-slimpro: Fix wrong pointer passed to PTR_ERR() Wei Yongjun
2021-11-01 17:11 ` Sudeep Holla
2021-11-06 21:28 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).