diff options
-rw-r--r-- | security/keys/key.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/keys/key.c b/security/keys/key.c index bd5a272f28a6..346fbf201c22 100644 --- a/security/keys/key.c +++ b/security/keys/key.c | |||
@@ -597,7 +597,7 @@ int key_reject_and_link(struct key *key, | |||
597 | 597 | ||
598 | mutex_unlock(&key_construction_mutex); | 598 | mutex_unlock(&key_construction_mutex); |
599 | 599 | ||
600 | if (keyring) | 600 | if (keyring && link_ret == 0) |
601 | __key_link_end(keyring, &key->index_key, edit); | 601 | __key_link_end(keyring, &key->index_key, edit); |
602 | 602 | ||
603 | /* wake up anyone waiting for a key to be constructed */ | 603 | /* wake up anyone waiting for a key to be constructed */ |