From: "Marcus Hüwe" <suse-tux@gmx.de>
To: keyrings@vger.kernel.org
Subject: Re: [PATCH] keys: Do not check the retval of commit_creds in join_session_keyring
Date: Mon, 14 Oct 2019 13:06:05 +0000 [thread overview]
Message-ID: <20191014130604.u65ohezf6usjkico@linux> (raw)
In-Reply-To: <044b34c4388405e995e38fb57fc120361bf962db.1568124150.git.suse-tux@gmx.de>
Just a gentle ping - any news on this?:)
On 2019-09-10 16:07:59 +0200, Marcus Huewe wrote:
> Do not check the return value of the commit_creds call in
> join_session_keyring in order to make the code more concise.
> Since commit_creds always returns 0, the if-statement is not needed
> and the session keyring's serial can be directly assigned to the
> "ret" variable.
>
> Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
> ---
> security/keys/process_keys.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
> index 09541de31f2f..e7cd1ff84709 100644
> --- a/security/keys/process_keys.c
> +++ b/security/keys/process_keys.c
> @@ -840,7 +840,7 @@ long join_session_keyring(const char *name)
> const struct cred *old;
> struct cred *new;
> struct key *keyring;
> - long ret, serial;
> + long ret;
>
> new = prepare_creds();
> if (!new)
> @@ -853,10 +853,8 @@ long join_session_keyring(const char *name)
> if (ret < 0)
> goto error;
>
> - serial = new->session_keyring->serial;
> - ret = commit_creds(new);
> - if (ret == 0)
> - ret = serial;
> + ret = new->session_keyring->serial;
> + commit_creds(new);
> goto okay;
> }
>
> --
> 2.22.0
>
next prev parent reply other threads:[~2019-10-14 13:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-10 14:07 [PATCH] keys: Do not check the retval of commit_creds in join_session_keyring Marcus Huewe
2019-10-14 13:06 ` Marcus Hüwe [this message]
2020-06-12 11:25 ` Marcus Huewe
2020-06-17 1:46 ` Jarkko Sakkinen
2020-07-28 11:06 ` Marcus Hüwe
2020-08-17 21:17 ` Jarkko Sakkinen
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=20191014130604.u65ohezf6usjkico@linux \
--to=suse-tux@gmx.de \
--cc=keyrings@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.