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:16:16 -0700
commitdde8dafc185bc593aad762dc05afbf6b43ba5e18 (patch)
tree3bc616e015de4fd9d4ca9329b66085cc92614668
parent913fd105f7ff3c7439f5b67fd10bf83077e2fe1a (diff)
downloadkernel-common-dde8dafc185bc593aad762dc05afbf6b43ba5e18.tar.gz
kernel-common-dde8dafc185bc593aad762dc05afbf6b43ba5e18.tar.bz2
kernel-common-dde8dafc185bc593aad762dc05afbf6b43ba5e18.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 5c23afb31ece..931cfda6e1f9 100644
--- a/security/keys/process_keys.c
+++ b/security/keys/process_keys.c
@@ -509,7 +509,7 @@ try_again:
ret = install_thread_keyring();
if (ret < 0) {
- key = ERR_PTR(ret);
+ key_ref = ERR_PTR(ret);
goto error;
}
goto reget_creds;
@@ -527,7 +527,7 @@ try_again:
ret = install_process_keyring();
if (ret < 0) {
- key = ERR_PTR(ret);
+ key_ref = ERR_PTR(ret);
goto error;
}
goto reget_creds;
@@ -586,7 +586,7 @@ try_again:
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: