diff options
author | Jesper Juhl <juhl-lkml@dif.dk> | 2005-07-06 16:51:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-07-06 16:51:00 -0400 |
commit | 8279dd748f9704b811e528b31304e2fab026abc5 (patch) | |
tree | d824994f48492dc3910ec3bf82d147cd8f796f20 | |
parent | b4634484815e1879512a23e4f59eef648135c30a (diff) |
[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 <juhl-lkml@dif.dk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | crypto/cipher.c | 3 | ||||
-rw-r--r-- | crypto/hmac.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/crypto/cipher.c b/crypto/cipher.c index f434ce7c2d0b..69264497b48c 100644 --- a/crypto/cipher.c +++ b/crypto/cipher.c | |||
@@ -336,6 +336,5 @@ out: | |||
336 | 336 | ||
337 | void crypto_exit_cipher_ops(struct crypto_tfm *tfm) | 337 | void crypto_exit_cipher_ops(struct crypto_tfm *tfm) |
338 | { | 338 | { |
339 | if (tfm->crt_cipher.cit_iv) | 339 | kfree(tfm->crt_cipher.cit_iv); |
340 | kfree(tfm->crt_cipher.cit_iv); | ||
341 | } | 340 | } |
diff --git a/crypto/hmac.c b/crypto/hmac.c index 847df9263e16..da0456b37109 100644 --- a/crypto/hmac.c +++ b/crypto/hmac.c | |||
@@ -49,8 +49,7 @@ int crypto_alloc_hmac_block(struct crypto_tfm *tfm) | |||
49 | 49 | ||
50 | void crypto_free_hmac_block(struct crypto_tfm *tfm) | 50 | void crypto_free_hmac_block(struct crypto_tfm *tfm) |
51 | { | 51 | { |
52 | if (tfm->crt_digest.dit_hmac_block) | 52 | kfree(tfm->crt_digest.dit_hmac_block); |
53 | kfree(tfm->crt_digest.dit_hmac_block); | ||
54 | } | 53 | } |
55 | 54 | ||
56 | void crypto_hmac_init(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen) | 55 | void crypto_hmac_init(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen) |