From: Jesper Juhl Date: Wed, 6 Jul 2005 20:51:00 +0000 (-0700) Subject: [CRYPTO] Don't check for NULL before kfree() X-Git-Tag: v2.6.13-rc3~312^2~13 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=8279dd748f9704b811e528b31304e2fab026abc5;p=linux-2.6-omap-h63xx.git [CRYPTO] Don't check for NULL before kfree() Checking a pointer for NULL before calling kfree() on it is redundant. This patch removes such checks from crypto/ Signed-off-by: Jesper Juhl Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/crypto/cipher.c b/crypto/cipher.c index f434ce7c2d0..69264497b48 100644 --- a/crypto/cipher.c +++ b/crypto/cipher.c @@ -336,6 +336,5 @@ out: void crypto_exit_cipher_ops(struct crypto_tfm *tfm) { - if (tfm->crt_cipher.cit_iv) - kfree(tfm->crt_cipher.cit_iv); + kfree(tfm->crt_cipher.cit_iv); } diff --git a/crypto/hmac.c b/crypto/hmac.c index 847df9263e1..da0456b3710 100644 --- a/crypto/hmac.c +++ b/crypto/hmac.c @@ -49,8 +49,7 @@ int crypto_alloc_hmac_block(struct crypto_tfm *tfm) void crypto_free_hmac_block(struct crypto_tfm *tfm) { - if (tfm->crt_digest.dit_hmac_block) - kfree(tfm->crt_digest.dit_hmac_block); + kfree(tfm->crt_digest.dit_hmac_block); } void crypto_hmac_init(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen)