]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[CRYPTO] Don't check for NULL before kfree()
authorJesper Juhl <juhl-lkml@dif.dk>
Wed, 6 Jul 2005 20:51:00 +0000 (13:51 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Jul 2005 20:51:00 +0000 (13:51 -0700)
Checking a pointer for NULL before calling kfree() on it is redundant.
This patch removes such checks from crypto/

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
crypto/cipher.c
crypto/hmac.c

index f434ce7c2d0b372aa75b3c4d8d2ac1b333e2f4e2..69264497b48c2466ed0b5619eeb98da8394ffa47 100644 (file)
@@ -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);
 }
index 847df9263e163fe08ae3dfec3115203dbe1884e3..da0456b37109513b472f29241a26addd69bdedbb 100644 (file)
@@ -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)