2020-04-15 21:28:54

by Tianjia Zhang

[permalink] [raw]
Subject: [PATCH 0/2] Simplify the implementation of some functions in IMA

Simplify the implementation of some functions in IMA.

Tianjia Zhang (2):
ima: simplify function ima_store_template
ima: simplify function process_buffer_measurement

security/integrity/ima/ima_api.c | 3 +--
security/integrity/ima/ima_main.c | 12 ++++++------
2 files changed, 7 insertions(+), 8 deletions(-)

--
2.17.1


2020-04-15 21:29:24

by Tianjia Zhang

[permalink] [raw]
Subject: [PATCH 1/2] ima: simplify function ima_store_template

The 'result' here is not necessary, remove redundant code,
the code is more concise.

Signed-off-by: Tianjia Zhang <[email protected]>
---
security/integrity/ima/ima_api.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c
index f6bc00914aa5..9121257c9dc6 100644
--- a/security/integrity/ima/ima_api.c
+++ b/security/integrity/ima/ima_api.c
@@ -118,8 +118,7 @@ int ima_store_template(struct ima_template_entry *entry,
memcpy(entry->digest, hash.hdr.digest, hash.hdr.length);
}
entry->pcr = pcr;
- result = ima_add_template_entry(entry, violation, op, inode, filename);
- return result;
+ return ima_add_template_entry(entry, violation, op, inode, filename);
}

/*
--
2.17.1