Linux-Crypto Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH][next] crypto: sa2ul - Fix inconsistent IS_ERR and PTR_ERR
@ 2020-07-24 16:50 Gustavo A. R. Silva
  2020-07-31 13:32 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2020-07-24 16:50 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller, Keerthy, Tero Kristo
  Cc: linux-crypto, linux-kernel, Gustavo A. R. Silva

Fix inconsistent IS_ERR and PTR_ERR in sa_dma_init(). The proper pointer
to be passed as argument to PTR_ERR() is dd->dma_tx.

This bug was detected with the help of Coccinelle.

Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 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;
-- 
2.27.0


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

* Re: [PATCH][next] crypto: sa2ul - Fix inconsistent IS_ERR and PTR_ERR
  2020-07-24 16:50 [PATCH][next] crypto: sa2ul - Fix inconsistent IS_ERR and PTR_ERR Gustavo A. R. Silva
@ 2020-07-31 13:32 ` Herbert Xu
  2020-07-31 15:17   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2020-07-31 13:32 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: David S. Miller, Keerthy, Tero Kristo, linux-crypto, linux-kernel

On Fri, Jul 24, 2020 at 11:50:27AM -0500, Gustavo A. R. Silva wrote:
> Fix inconsistent IS_ERR and PTR_ERR in sa_dma_init(). The proper pointer
> to be passed as argument to PTR_ERR() is dd->dma_tx.
> 
> This bug was detected with the help of Coccinelle.
> 
> Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
>  drivers/crypto/sa2ul.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  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] 3+ messages in thread

* Re: [PATCH][next] crypto: sa2ul - Fix inconsistent IS_ERR and PTR_ERR
  2020-07-31 13:32 ` Herbert Xu
@ 2020-07-31 15:17   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2020-07-31 15:17 UTC (permalink / raw)
  To: Herbert Xu, Gustavo A. R. Silva
  Cc: David S. Miller, Keerthy, Tero Kristo, linux-crypto, linux-kernel



On 7/31/20 08:32, Herbert Xu wrote:
> On Fri, Jul 24, 2020 at 11:50:27AM -0500, Gustavo A. R. Silva wrote:
>> Fix inconsistent IS_ERR and PTR_ERR in sa_dma_init(). The proper pointer
>> to be passed as argument to PTR_ERR() is dd->dma_tx.
>>
>> This bug was detected with the help of Coccinelle.
>>
>> Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>> ---
>>  drivers/crypto/sa2ul.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Patch applied.  Thanks.
> 

Awesome. :)

Thanks
--
Gustavo

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24 16:50 [PATCH][next] crypto: sa2ul - Fix inconsistent IS_ERR and PTR_ERR Gustavo A. R. Silva
2020-07-31 13:32 ` Herbert Xu
2020-07-31 15:17   ` Gustavo A. R. Silva

Linux-Crypto Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-crypto/0 linux-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-crypto linux-crypto/ https://lore.kernel.org/linux-crypto \
		linux-crypto@vger.kernel.org
	public-inbox-index linux-crypto

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-crypto


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git