linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.vnet.ibm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: David Safford <safford@us.ibm.com>,
	David Howells <dhowells@redhat.com>,
	James Morris <james.l.morris@oracle.com>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	linux-security-module@vger.kernel.org, keyrings@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] KEYS: Fix an error code in request_master_key()
Date: Fri, 16 Dec 2016 11:50:33 -0500	[thread overview]
Message-ID: <1481907033.17553.78.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <20161216090827.GA7285@elgon.mountain>

Hi Dan,

On Fri, 2016-12-16 at 12:08 +0300, Dan Carpenter wrote:
> This function has two callers and neither are able to handle a NULL
> return.  Really, -EINVAL is the correct thing return here anyway.  This
> fixes some static checker warnings like:
> 
> 	security/keys/encrypted-keys/encrypted.c:709 encrypted_key_decrypt()
> 	error: uninitialized symbol 'master_key'.
> 
> Fixes: 7e70cb497850 ("keys: add new key-type encrypted")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks!

Mimi

> diff --git a/security/keys/encrypted-keys/encrypted.c b/security/keys/encrypted-keys/encrypted.c
> index 17a06105ccb6..d7a4969b2dd3 100644
> --- a/security/keys/encrypted-keys/encrypted.c
> +++ b/security/keys/encrypted-keys/encrypted.c
> @@ -437,7 +437,7 @@ static struct skcipher_request *init_skcipher_req(const u8 *key,
>  static struct key *request_master_key(struct encrypted_key_payload *epayload,
>  				      const u8 **master_key, size_t *master_keylen)
>  {
> -	struct key *mkey = NULL;
> +	struct key *mkey = ERR_PTR(-EINVAL);
> 
>  	if (!strncmp(epayload->master_desc, KEY_TRUSTED_PREFIX,
>  		     KEY_TRUSTED_PREFIX_LEN)) {
> 

  reply	other threads:[~2016-12-16 16:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16  9:08 [patch] KEYS: Fix an error code in request_master_key() Dan Carpenter
2016-12-16 16:50 ` Mimi Zohar [this message]
2017-01-12 13:08 ` David Howells
2017-01-16 13:58   ` Mimi Zohar

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=1481907033.17553.78.camel@linux.vnet.ibm.com \
    --to=zohar@linux.vnet.ibm.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dhowells@redhat.com \
    --cc=james.l.morris@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=safford@us.ibm.com \
    --cc=serge@hallyn.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).