Commit a7b1ba23 authored by Suniel Mahesh's avatar Suniel Mahesh Committed by Greg Kroah-Hartman

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: default avatarSuniel Mahesh <sunil.m@techveda.org>
Acked-by: default avatarGilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a457c17
...@@ -297,20 +297,14 @@ static int ssi_hash_map_request(struct device *dev, ...@@ -297,20 +297,14 @@ static int ssi_hash_map_request(struct device *dev,
fail1: fail1:
kfree(state->digest_buff); kfree(state->digest_buff);
fail_digest_result_buff: fail_digest_result_buff:
if (state->digest_result_buff) {
kfree(state->digest_result_buff); kfree(state->digest_result_buff);
state->digest_result_buff = NULL; state->digest_result_buff = NULL;
}
fail_buff1: fail_buff1:
if (state->buff1) {
kfree(state->buff1); kfree(state->buff1);
state->buff1 = NULL; state->buff1 = NULL;
}
fail_buff0: fail_buff0:
if (state->buff0) {
kfree(state->buff0); kfree(state->buff0);
state->buff0 = NULL; state->buff0 = NULL;
}
fail0: fail0:
return rc; return rc;
} }
...@@ -2326,11 +2320,8 @@ int ssi_hash_alloc(struct ssi_drvdata *drvdata) ...@@ -2326,11 +2320,8 @@ int ssi_hash_alloc(struct ssi_drvdata *drvdata)
return 0; return 0;
fail: fail:
if (drvdata->hash_handle) {
kfree(drvdata->hash_handle); kfree(drvdata->hash_handle);
drvdata->hash_handle = NULL; drvdata->hash_handle = NULL;
}
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment