Skip to content

Commit

Permalink
[CRYPTO] Don't check for NULL before kfree()
Browse files Browse the repository at this point in the history
Checking a pointer for NULL before calling kfree() on it is redundant.
This patch removes such checks from crypto/

Signed-off-by: Jesper Juhl <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Jesper Juhl authored and davem330 committed Jul 6, 2005
1 parent b463448 commit 8279dd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions crypto/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,5 @@ int crypto_init_cipher_ops(struct crypto_tfm *tfm)

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);
}
3 changes: 1 addition & 2 deletions crypto/hmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8279dd7

Please sign in to comment.