summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-05-17 14:42:35 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-05 11:08:47 -0700
commite24ad12540142e1ae7e24da1072e977c5b17003b (patch)
tree6bcb5f1640ebeb1f00d50bc64949adaa9086d31c
parent648efc40754d15a7f38fc31d50bdc4e04024630d (diff)
downloadlwn-e24ad12540142e1ae7e24da1072e977c5b17003b.tar.gz
lwn-e24ad12540142e1ae7e24da1072e977c5b17003b.zip
KEYS: Return more accurate error codes
commit 4d09ec0f705cf88a12add029c058b53f288cfaa2 upstream. We were using the wrong variable here so the error codes weren't being returned properly. The original code returns -ENOKEY. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <jmorris@namei.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--security/keys/process_keys.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
index 45b240af6dbe..b04a2bd0856d 100644
--- a/security/keys/process_keys.c
+++ b/security/keys/process_keys.c
@@ -592,7 +592,7 @@ key_ref_t lookup_user_key(struct task_struct *context, key_serial_t id,
ret = install_thread_keyring(context);
if (ret < 0) {
- key = ERR_PTR(ret);
+ key_ref = ERR_PTR(ret);
goto error;
}
}
@@ -609,7 +609,7 @@ key_ref_t lookup_user_key(struct task_struct *context, key_serial_t id,
ret = install_process_keyring(context);
if (ret < 0) {
- key = ERR_PTR(ret);
+ key_ref = ERR_PTR(ret);
goto error;
}
}
@@ -665,7 +665,7 @@ key_ref_t lookup_user_key(struct task_struct *context, key_serial_t id,
case KEY_SPEC_GROUP_KEYRING:
/* group keyrings are not yet supported */
- key = ERR_PTR(-EINVAL);
+ key_ref = ERR_PTR(-EINVAL);
goto error;
case KEY_SPEC_REQKEY_AUTH_KEY: