All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] crypto: sa2ul - fix wrong pointer passed to PTR_ERR()
@ 2020-07-25  6:34 ` Wei Yongjun
  0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2020-07-25  6:34 UTC (permalink / raw)
  To: Herbert Xu, Keerthy
  Cc: Wei Yongjun, linux-crypto, kernel-janitors, Hulk Robot

PTR_ERR should access the value just tested by IS_ERR, otherwise
the wrong error code will be returned.

Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/crypto/sa2ul.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
index ebcdffcdb686..5bc099052bd2 100644
--- a/drivers/crypto/sa2ul.c
+++ b/drivers/crypto/sa2ul.c
@@ -2259,7 +2259,7 @@ static int sa_dma_init(struct sa_crypto_data *dd)
 
 	dd->dma_tx = dma_request_chan(dd->dev, "tx");
 	if (IS_ERR(dd->dma_tx)) {
-		if (PTR_ERR(dd->dma_rx1) != -EPROBE_DEFER)
+		if (PTR_ERR(dd->dma_tx) != -EPROBE_DEFER)
 			dev_err(dd->dev, "Unable to request tx DMA channel\n");
 		ret = PTR_ERR(dd->dma_tx);
 		goto err_dma_tx;




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

* [PATCH -next] crypto: sa2ul - fix wrong pointer passed to PTR_ERR()
@ 2020-07-25  6:34 ` Wei Yongjun
  0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2020-07-25  6:34 UTC (permalink / raw)
  To: Herbert Xu, Keerthy
  Cc: Wei Yongjun, linux-crypto, kernel-janitors, Hulk Robot

PTR_ERR should access the value just tested by IS_ERR, otherwise
the wrong error code will be returned.

Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/crypto/sa2ul.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
index ebcdffcdb686..5bc099052bd2 100644
--- a/drivers/crypto/sa2ul.c
+++ b/drivers/crypto/sa2ul.c
@@ -2259,7 +2259,7 @@ static int sa_dma_init(struct sa_crypto_data *dd)
 
 	dd->dma_tx = dma_request_chan(dd->dev, "tx");
 	if (IS_ERR(dd->dma_tx)) {
-		if (PTR_ERR(dd->dma_rx1) != -EPROBE_DEFER)
+		if (PTR_ERR(dd->dma_tx) != -EPROBE_DEFER)
 			dev_err(dd->dev, "Unable to request tx DMA channel\n");
 		ret = PTR_ERR(dd->dma_tx);
 		goto err_dma_tx;

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

* Re: [PATCH -next] crypto: sa2ul - fix wrong pointer passed to PTR_ERR()
  2020-07-25  6:34 ` Wei Yongjun
@ 2020-07-31  7:28   ` Herbert Xu
  -1 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2020-07-31  7:28 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Keerthy, linux-crypto, kernel-janitors, Hulk Robot

On Sat, Jul 25, 2020 at 06:34:40AM +0000, Wei Yongjun wrote:
> PTR_ERR should access the value just tested by IS_ERR, otherwise
> the wrong error code will be returned.
> 
> Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/crypto/sa2ul.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Someone has sent a similar patch already.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH -next] crypto: sa2ul - fix wrong pointer passed to PTR_ERR()
@ 2020-07-31  7:28   ` Herbert Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2020-07-31  7:28 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Keerthy, linux-crypto, kernel-janitors, Hulk Robot

On Sat, Jul 25, 2020 at 06:34:40AM +0000, Wei Yongjun wrote:
> PTR_ERR should access the value just tested by IS_ERR, otherwise
> the wrong error code will be returned.
> 
> Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/crypto/sa2ul.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Someone has sent a similar patch already.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2020-07-31  7:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-25  6:34 [PATCH -next] crypto: sa2ul - fix wrong pointer passed to PTR_ERR() Wei Yongjun
2020-07-25  6:34 ` Wei Yongjun
2020-07-31  7:28 ` Herbert Xu
2020-07-31  7:28   ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.