diff options
author | Suniel Mahesh <sunil.m@techveda.org> | 2017-07-20 16:37:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-28 07:55:24 +0300 |
commit | a7b1ba23556215952099274a0f008643de832f70 (patch) | |
tree | 1ac4cfc93a5574b87edbff7cfc0035ec3b450d92 /drivers/staging/ccree | |
parent | 4a457c1710ab6cf9885b93a9aa93e8718abaca45 (diff) | |
download | linux-a7b1ba23556215952099274a0f008643de832f70.tar.xz |
staging: ccree: Fix unnecessary NULL check before kfree'ing it
kfree(NULL) is safe and their is no need for a NULL check. Pointed out
by checkpatch.
Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Acked-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ccree')
-rw-r--r-- | drivers/staging/ccree/ssi_hash.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index 7fd3c3ce42a5..1a405bbadf6d 100644 --- a/drivers/staging/ccree/ssi_hash.c +++ b/drivers/staging/ccree/ssi_hash.c @@ -297,20 +297,14 @@ fail2: fail1: kfree(state->digest_buff); fail_digest_result_buff: - if (state->digest_result_buff) { - kfree(state->digest_result_buff); - state->digest_result_buff = NULL; - } + kfree(state->digest_result_buff); + state->digest_result_buff = NULL; fail_buff1: - if (state->buff1) { - kfree(state->buff1); - state->buff1 = NULL; - } + kfree(state->buff1); + state->buff1 = NULL; fail_buff0: - if (state->buff0) { - kfree(state->buff0); - state->buff0 = NULL; - } + kfree(state->buff0); + state->buff0 = NULL; fail0: return rc; } @@ -2326,11 +2320,8 @@ int ssi_hash_alloc(struct ssi_drvdata *drvdata) return 0; fail: - - if (drvdata->hash_handle) { - kfree(drvdata->hash_handle); - drvdata->hash_handle = NULL; - } + kfree(drvdata->hash_handle); + drvdata->hash_handle = NULL; return rc; } |