RE: [PATCH] crypto: fix safexcel_hash warning PTR_ERR_OR_ZERO can be used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: linux-crypto-owner@xxxxxxxxxxxxxxx <linux-crypto-owner@xxxxxxxxxxxxxxx> On Behalf Of
> Tian Tao
> Sent: Saturday, October 19, 2019 2:45 AM
> To: gilad@xxxxxxxxxxxxx; herbert@xxxxxxxxxxxxxxxxxxx; davem@xxxxxxxxxxxxx; linux-
> crypto@xxxxxxxxxxxxxxx
> Cc: linuxarm@xxxxxxxxxx
> Subject: [PATCH] crypto: fix safexcel_hash warning PTR_ERR_OR_ZERO can be used
> 
> fix below warning reported by coccicheck.
> the below code is only in the crypto-dev tree currently.
> drivers/crypto/inside-secure/safexcel_cipher.c:2527:1-3: WARNING:
> PTR_ERR_OR_ZERO can be used.
> 
> Fixes: 38f21b4bab11 ("crypto: inside-secure - Added support for the AES XCBC ahash")
> 
> Signed-off-by: Tian Tao <tiantao6@xxxxxxxxxx>
> ---
>  drivers/crypto/inside-secure/safexcel_hash.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-
> secure/safexcel_hash.c
> index 85c3a07..3c71151 100644
> --- a/drivers/crypto/inside-secure/safexcel_hash.c
> +++ b/drivers/crypto/inside-secure/safexcel_hash.c
> @@ -2109,10 +2109,8 @@ static int safexcel_xcbcmac_cra_init(struct crypto_tfm *tfm)
> 
>  	safexcel_ahash_cra_init(tfm);
>  	ctx->kaes = crypto_alloc_cipher("aes", 0, 0);
> -	if (IS_ERR(ctx->kaes))
> -		return PTR_ERR(ctx->kaes);
> 
> -	return 0;
> +	return PTR_ERR_OR_ZERO(ctx->kaes);
>  }
Thanks for spotting, but a similar patch has already been applied.
So this patch is obsolete now.

> 
>  static void safexcel_xcbcmac_cra_exit(struct crypto_tfm *tfm)
> --
> 2.7.4


Regards,
Pascal van Leeuwen
Silicon IP Architect, Multi-Protocol Engines @ Verimatrix
www.insidesecure.com




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux