linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
To: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>,
	zohar@linux.ibm.com, dmitry.kasatkin@gmail.com,
	jmorris@namei.org, serge@hallyn.com,
	zhangliguang@linux.alibaba.com, zhang.jia@linux.alibaba.com
Cc: linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] ima: simplify function process_buffer_measurement
Date: Tue, 14 Apr 2020 08:18:09 -0700	[thread overview]
Message-ID: <a18c37b9-7534-86c4-3bae-111ac1fa4053@linux.microsoft.com> (raw)
In-Reply-To: <20200414114850.98622-3-tianjia.zhang@linux.alibaba.com>

On 4/14/20 4:48 AM, Tianjia Zhang wrote:

> Remove duplicate judgment code to make it more suitable for linux
> code style.
> 
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.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);
>   }

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

      reply	other threads:[~2020-04-14 15:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 11:48 [PATCH 0/2] Simplify the implementation of some functions in IMA Tianjia Zhang
2020-04-14 11:48 ` [PATCH 1/2] ima: simplify function ima_store_template Tianjia Zhang
2020-04-14 15:17   ` Lakshmi Ramasubramanian
2020-04-14 11:48 ` [PATCH 2/2] ima: simplify function process_buffer_measurement Tianjia Zhang
2020-04-14 15:18   ` Lakshmi Ramasubramanian [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a18c37b9-7534-86c4-3bae-111ac1fa4053@linux.microsoft.com \
    --to=nramas@linux.microsoft.com \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=jmorris@namei.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=serge@hallyn.com \
    --cc=tianjia.zhang@linux.alibaba.com \
    --cc=zhang.jia@linux.alibaba.com \
    --cc=zhangliguang@linux.alibaba.com \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).