All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Morris <james.l.morris@oracle.com>
To: linux-security-module@vger.kernel.org
Subject: Re: [PATCH] security: keys: remove redundant assignment to key_ref
Date: Tue, 05 Dec 2017 00:18:10 +0000	[thread overview]
Message-ID: <alpine.LFD.2.20.1712051116130.21642@localhost> (raw)
In-Reply-To: <20171204181424.15808-1-colin.king@canonical.com>

On Mon, 4 Dec 2017, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable key_ref is being assigned a value that is never read;
> key_ref is being re-assigned a few statements later.  Hence this
> assignment is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

I think a general cleanup in that function to make all of these follow the 
pattern:

	if (something) {
		key_ref = ERR_PTR(-error);
		goto error;
	}

rather than unconditionally setting the error first, would be better, but 
this is a clear enough fix on its own.

Reviewed-by: James Morris <james.l.morris@oracle.com>


-- 
James Morris
<james.l.morris@oracle.com>


WARNING: multiple messages have this Message-ID (diff)
From: james.l.morris@oracle.com (James Morris)
To: linux-security-module@vger.kernel.org
Subject: [PATCH] security: keys: remove redundant assignment to key_ref
Date: Tue, 5 Dec 2017 11:18:10 +1100 (AEDT)	[thread overview]
Message-ID: <alpine.LFD.2.20.1712051116130.21642@localhost> (raw)
In-Reply-To: <20171204181424.15808-1-colin.king@canonical.com>

On Mon, 4 Dec 2017, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable key_ref is being assigned a value that is never read;
> key_ref is being re-assigned a few statements later.  Hence this
> assignment is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

I think a general cleanup in that function to make all of these follow the 
pattern:

	if (something) {
		key_ref = ERR_PTR(-error);
		goto error;
	}

rather than unconditionally setting the error first, would be better, but 
this is a clear enough fix on its own.

Reviewed-by: James Morris <james.l.morris@oracle.com>


-- 
James Morris
<james.l.morris@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: James Morris <james.l.morris@oracle.com>
To: Colin King <colin.king@canonical.com>
Cc: David Howells <dhowells@redhat.com>,
	"Serge E . Hallyn" <serge@hallyn.com>,
	keyrings@vger.kernel.org, linux-security-module@vger.kernel.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] security: keys: remove redundant assignment to key_ref
Date: Tue, 5 Dec 2017 11:18:10 +1100 (AEDT)	[thread overview]
Message-ID: <alpine.LFD.2.20.1712051116130.21642@localhost> (raw)
In-Reply-To: <20171204181424.15808-1-colin.king@canonical.com>

On Mon, 4 Dec 2017, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable key_ref is being assigned a value that is never read;
> key_ref is being re-assigned a few statements later.  Hence this
> assignment is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

I think a general cleanup in that function to make all of these follow the 
pattern:

	if (something) {
		key_ref = ERR_PTR(-error);
		goto error;
	}

rather than unconditionally setting the error first, would be better, but 
this is a clear enough fix on its own.

Reviewed-by: James Morris <james.l.morris@oracle.com>


-- 
James Morris
<james.l.morris@oracle.com>

  reply	other threads:[~2017-12-05  0:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 18:14 [PATCH] security: keys: remove redundant assignment to key_ref Colin King
2017-12-04 18:14 ` Colin King
2017-12-04 18:14 ` Colin King
2017-12-05  0:18 ` James Morris [this message]
2017-12-05  0:18   ` James Morris
2017-12-05  0:18   ` James Morris
2017-12-06 14:50   ` David Howells
2017-12-06 14:50     ` David Howells
2017-12-06 14:50     ` David Howells
2017-12-06 14:53     ` Julia Lawall
2017-12-06 14:53       ` Julia Lawall
2017-12-06 14:53       ` Julia Lawall
2017-12-07  0:49       ` James Morris
2017-12-07  0:49         ` James Morris
2017-12-07  0:49         ` James Morris

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=alpine.LFD.2.20.1712051116130.21642@localhost \
    --to=james.l.morris@oracle.com \
    --cc=linux-security-module@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.