aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/keyctl.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--security/keys/keyctl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index ab0b337c84b4..562f7fe287a0 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -1406,11 +1406,9 @@ long keyctl_assume_authority(key_serial_t id)
}
ret = keyctl_change_reqkey_auth(authkey);
- if (ret < 0)
- goto error;
+ if (ret == 0)
+ ret = authkey->serial;
key_put(authkey);
-
- ret = authkey->serial;
error:
return ret;
}