[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YJhJVEqIZAkU9xzp@kernel.org>
Date: Sun, 9 May 2021 23:43:00 +0300
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Yang Li <yang.lee@...ux.alibaba.com>
Cc: dhowells@...hat.com, jmorris@...ei.org, serge@...lyn.com,
nathan@...nel.org, ndesaulniers@...gle.com,
keyrings@...r.kernel.org, linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com
Subject: Re: [PATCH] Keys: Remove redundant initialization of cred
On Sat, May 08, 2021 at 05:51:21PM +0800, Yang Li wrote:
> Pointer cred is being initialized however this value is never
> read as cred is assigned an updated value from the returned
> call to get_current_cred(). Remove the redundant initialization.
>
> Cleans up clang warning:
>
> security/keys/request_key.c:119:21: warning: Value stored to 'cred'
> during its initialization is never read
> [clang-analyzer-deadcode.DeadStores]
>
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Fixes: 'commit bb952bb98a7e ("CRED: Separate per-task-group keyrings from signal_struct")'
> Signed-off-by: Yang Li <yang.lee@...ux.alibaba.com>
> ---
> security/keys/request_key.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/security/keys/request_key.c b/security/keys/request_key.c
> index 2da4404..873c31f 100644
> --- a/security/keys/request_key.c
> +++ b/security/keys/request_key.c
> @@ -116,7 +116,7 @@ static int call_sbin_request_key(struct key *authkey, void *aux)
> {
> static char const request_key[] = "/sbin/request-key";
> struct request_key_auth *rka = get_request_key_auth(authkey);
> - const struct cred *cred = current_cred();
> + const struct cred *cred;
> key_serial_t prkey, sskey;
> struct key *key = rka->target_key, *keyring, *session, *user_session;
> char *argv[9], *envp[3], uid_str[12], gid_str[12];
> --
> 1.8.3.1
>
>
Reviewed-by: Jarkko Sakkinen <jarkko@...nel.org>
/Jarkko
Powered by blists - more mailing lists