summaryrefslogtreecommitdiffstats
path: root/kernel/security/keys
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/security/keys')
-rw-r--r--kernel/security/keys/keyring.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/security/keys/keyring.c b/kernel/security/keys/keyring.c
index e72548b58..d33437007 100644
--- a/kernel/security/keys/keyring.c
+++ b/kernel/security/keys/keyring.c
@@ -1181,9 +1181,11 @@ void __key_link_end(struct key *keyring,
if (index_key->type == &key_type_keyring)
up_write(&keyring_serialise_link_sem);
- if (edit && !edit->dead_leaf) {
- key_payload_reserve(keyring,
- keyring->datalen - KEYQUOTA_LINK_BYTES);
+ if (edit) {
+ if (!edit->dead_leaf) {
+ key_payload_reserve(keyring,
+ keyring->datalen - KEYQUOTA_LINK_BYTES);
+ }
assoc_array_cancel_edit(edit);
}
up_write(&keyring->sem);