diff options
author | Christoph Paasch <christoph.paasch@uclouvain.be> | 2013-12-01 18:05:20 -0500 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2013-12-02 20:46:32 -0500 |
commit | 09ae6345721afbb7cf3e0920209b140cbe7bff0d (patch) | |
tree | 36196a39f1b68dc76f4d4b1103d67ee118b999fd /security | |
parent | a45299e72737c528975546a0680cace5d7364d27 (diff) |
ima: Do not free 'entry' before it is initialized
7bc5f447ce9d0 (ima: define new function ima_alloc_init_template() to
API) moved the initialization of 'entry' in ima_add_boot_aggregate() a
bit more below, after the if (ima_used_chip).
So, 'entry' is not initialized while being inside this if-block. So, we
should not attempt to free it.
Found by Coverity (CID: 1131971)
Fixes: 7bc5f447ce9d0 (ima: define new function ima_alloc_init_template() to API)
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/integrity/ima/ima_init.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/security/integrity/ima/ima_init.c b/security/integrity/ima/ima_init.c index 15f34bd40abe..76b8e2c4fd38 100644 --- a/security/integrity/ima/ima_init.c +++ b/security/integrity/ima/ima_init.c | |||
@@ -63,7 +63,6 @@ static void __init ima_add_boot_aggregate(void) | |||
63 | result = ima_calc_boot_aggregate(&hash.hdr); | 63 | result = ima_calc_boot_aggregate(&hash.hdr); |
64 | if (result < 0) { | 64 | if (result < 0) { |
65 | audit_cause = "hashing_error"; | 65 | audit_cause = "hashing_error"; |
66 | kfree(entry); | ||
67 | goto err_out; | 66 | goto err_out; |
68 | } | 67 | } |
69 | } | 68 | } |