summaryrefslogtreecommitdiffstats
path: root/kernel/security/keys/key.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/security/keys/key.c')
-rw-r--r--kernel/security/keys/key.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/security/keys/key.c b/kernel/security/keys/key.c
index ab7997ded..534808915 100644
--- a/kernel/security/keys/key.c
+++ b/kernel/security/keys/key.c
@@ -578,7 +578,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->index_key, edit);
/* wake up anyone waiting for a key to be constructed */