aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-05-26 06:45:59 -0500
committerSimon Shields <keepcalm444@gmail.com>2016-06-30 18:21:44 +1000
commit28ea59dc1c4781c819996a65e60aa773f1da6765 (patch)
tree2d3bfbedba718db25d8419afd866e9bb5d402194 /security
parent2533a2b72074aefdbf2766857d06c39836d3e65e (diff)
downloadkernel_samsung_smdk4412-28ea59dc1c4781c819996a65e60aa773f1da6765.tar.gz
kernel_samsung_smdk4412-28ea59dc1c4781c819996a65e60aa773f1da6765.tar.bz2
kernel_samsung_smdk4412-28ea59dc1c4781c819996a65e60aa773f1da6765.zip
KEYS: potential uninitialized variable
If __key_link_begin() failed then "edit" would be uninitialized. I've added a check to fix that. Change-Id: I0e28bdba07f645437db2b08daf67ca27f16c6f5c Fixes: f70e2e06196a ('KEYS: Do preallocation for __key_link()') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Diffstat (limited to 'security')
-rw-r--r--security/keys/key.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/keys/key.c b/security/keys/key.c
index e1704f66846..d2765e4985b 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -580,7 +580,7 @@ int key_reject_and_link(struct key *key,
mutex_unlock(&key_construction_mutex);
- if (keyring)
+ if (keyring && link_ret == 0)
__key_link_end(keyring, key->type, prealloc);
/* wake up anyone waiting for a key to be constructed */