Documentation: DT: ASoC: add toshiba tc358749x
[firefly-linux-kernel-4.4.55.git] / security / keys / key.c
index ab7997ded7255258365169abaf820e811e0a7768..534808915371c2abf4801801fdccce72e7cd7759 100644 (file)
@@ -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 */