[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200414114850.98622-3-tianjia.zhang@linux.alibaba.com>
Date: Tue, 14 Apr 2020 19:48:50 +0800
From: Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>
To: zohar@...ux.ibm.com, dmitry.kasatkin@...il.com, jmorris@...ei.org,
serge@...lyn.com, zhangliguang@...ux.alibaba.com,
zhang.jia@...ux.alibaba.com
Cc: linux-integrity@...r.kernel.org,
linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org, tianjia.zhang@...ux.alibaba.com
Subject: [PATCH 2/2] ima: simplify function process_buffer_measurement
Remove duplicate judgment code to make it more suitable for linux
code style.
Signed-off-by: Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>
---
security/integrity/ima/ima_main.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index 9d0abedeae77..55cbbe97ce6e 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -750,15 +750,15 @@ void process_buffer_measurement(const void *buf, int size,
goto out;
ret = ima_store_template(entry, violation, NULL, buf, pcr);
-
- if (ret < 0)
- ima_free_template_entry(entry);
-
-out:
if (ret < 0)
- pr_devel("%s: failed, result: %d\n", __func__, ret);
+ goto out_free_entry;
return;
+
+out_free_entry:
+ ima_free_template_entry(entry);
+out:
+ pr_devel("%s: failed, result: %d\n", __func__, ret);
}
/**
--
2.17.1
Powered by blists - more mailing lists