All of
 help / color / mirror / Atom feed
From: Dan Carpenter <>
Subject: [patch] KEYS: potential uninitialized variable
Date: Thu, 26 May 2016 06:45:59 +0000	[thread overview]
Message-ID: <20160526064559.GA6738@mwanda> (raw)

If __key_link_begin() failed then "edit" would be uninitialized.  I've
added a check to fix that.

Fixes: f70e2e06196a ('KEYS: Do preallocation for __key_link()')
Signed-off-by: Dan Carpenter <>

diff --git a/security/keys/key.c b/security/keys/key.c
index bd5a272..346fbf2 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -597,7 +597,7 @@ int key_reject_and_link(struct key *key,
-	if (keyring)
+	if (keyring && link_ret = 0)
 		__key_link_end(keyring, &key->index_key, edit);
 	/* wake up anyone waiting for a key to be constructed */

             reply	other threads:[~2016-05-26  6:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26  6:45 Dan Carpenter [this message]
2016-05-27 14:02 ` David Howells
2016-06-16 14:48 [PATCH] " David Howells
2016-06-16 14:50 ` David Howells

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:

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

  git send-email \
    --in-reply-to=20160526064559.GA6738@mwanda \ \ \
    --subject='Re: [patch] KEYS: potential uninitialized variable' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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.