diff options
author | James Morris <jmorris@namei.org> | 2011-06-30 10:43:56 +0200 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2011-06-30 10:43:56 +0200 |
commit | 5b944a71a192977c1c018bbcfa0c52dca48e2368 (patch) | |
tree | 9f234c4a93bb28890ad086c846d2bf0b35f7f7ae /security/keys | |
parent | TOMOYO: Make several options configurable. (diff) | |
parent | Merge branch 'kvm-updates/3.0' of git://git.kernel.org/pub/scm/virt/kvm/kvm (diff) | |
download | linux-5b944a71a192977c1c018bbcfa0c52dca48e2368.tar.xz linux-5b944a71a192977c1c018bbcfa0c52dca48e2368.zip |
Merge branch 'linus' into next
Diffstat (limited to 'security/keys')
-rw-r--r-- | security/keys/request_key.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/security/keys/request_key.c b/security/keys/request_key.c index d31862e0aa1c..82465328c39b 100644 --- a/security/keys/request_key.c +++ b/security/keys/request_key.c @@ -71,9 +71,8 @@ EXPORT_SYMBOL(complete_request_key); * This is called in context of freshly forked kthread before kernel_execve(), * so we can simply install the desired session_keyring at this point. */ -static int umh_keys_init(struct subprocess_info *info) +static int umh_keys_init(struct subprocess_info *info, struct cred *cred) { - struct cred *cred = (struct cred*)current_cred(); struct key *keyring = info->data; return install_session_keyring_to_cred(cred, keyring); @@ -470,7 +469,7 @@ static struct key *construct_key_and_link(struct key_type *type, } else if (ret == -EINPROGRESS) { ret = 0; } else { - key = ERR_PTR(ret); + goto couldnt_alloc_key; } key_put(dest_keyring); @@ -480,6 +479,7 @@ static struct key *construct_key_and_link(struct key_type *type, construction_failed: key_negate_and_link(key, key_negative_timeout, NULL, NULL); key_put(key); +couldnt_alloc_key: key_put(dest_keyring); kleave(" = %d", ret); return ERR_PTR(ret); |