aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-12-28 19:41:51 -0500
committerJames Morris <jmorris@namei.org>2008-12-28 22:24:43 -0500
commiteca1bf5b4fab56d2feb1572d34d59fcd92ea7df3 (patch)
tree58ce85049625d01d52f3b32a6035bce9dbbc4ebf /security
parent3c92ec8ae91ecf59d88c798301833d7cf83f2179 (diff)
KEYS: Fix variable uninitialisation warnings
Fix variable uninitialisation warnings introduced in: commit 8bbf4976b59fc9fc2861e79cab7beb3f6d647640 Author: David Howells <dhowells@redhat.com> Date: Fri Nov 14 10:39:14 2008 +1100 KEYS: Alter use of key instantiation link-to-keyring argument As: security/keys/keyctl.c: In function 'keyctl_negate_key': security/keys/keyctl.c:976: warning: 'dest_keyring' may be used uninitialized in this function security/keys/keyctl.c: In function 'keyctl_instantiate_key': security/keys/keyctl.c:898: warning: 'dest_keyring' may be used uninitialized in this function Some versions of gcc notice that get_instantiation_key() doesn't always set *_dest_keyring, but fail to observe that if this happens then *_dest_keyring will not be read by the caller. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security')
-rw-r--r--security/keys/keyctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 7c72baa02f2e..6688765bd8b9 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -838,11 +838,11 @@ static long get_instantiation_keyring(key_serial_t ringid,
838{ 838{
839 key_ref_t dkref; 839 key_ref_t dkref;
840 840
841 *_dest_keyring = NULL;
842
841 /* just return a NULL pointer if we weren't asked to make a link */ 843 /* just return a NULL pointer if we weren't asked to make a link */
842 if (ringid == 0) { 844 if (ringid == 0)
843 *_dest_keyring = NULL;
844 return 0; 845 return 0;
845 }
846 846
847 /* if a specific keyring is nominated by ID, then use that */ 847 /* if a specific keyring is nominated by ID, then use that */
848 if (ringid > 0) { 848 if (ringid > 0) {