diff mbox series

[1/2] ima: simplify function ima_store_template

Message ID 20200414114850.98622-2-tianjia.zhang@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series Simplify the implementation of some functions in IMA | expand

Commit Message

tianjia.zhang April 14, 2020, 11:48 a.m. UTC
The 'result' here is not necessary, remove redundant code,
the code is more concise.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
---
 security/integrity/ima/ima_api.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Lakshmi Ramasubramanian April 14, 2020, 3:17 p.m. UTC | #1
On 4/14/20 4:48 AM, Tianjia Zhang wrote:

> The 'result' here is not necessary, remove redundant code,
> the code is more concise.
> 
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> ---
>   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);
>   }
>   
>   /*
> 


Reviewed-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
diff mbox series

Patch

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);
 }
 
 /*