Skip to content

Commit

Permalink
KEYS: Return more accurate error codes
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
error27 authored and James Morris committed May 17, 2010
1 parent c80901f commit 4d09ec0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions security/keys/process_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ key_ref_t lookup_user_key(key_serial_t id, unsigned long lflags,

ret = install_thread_keyring();
if (ret < 0) {
key = ERR_PTR(ret);
key_ref = ERR_PTR(ret);
goto error;
}
goto reget_creds;
Expand All @@ -526,7 +526,7 @@ key_ref_t lookup_user_key(key_serial_t id, unsigned long lflags,

ret = install_process_keyring();
if (ret < 0) {
key = ERR_PTR(ret);
key_ref = ERR_PTR(ret);
goto error;
}
goto reget_creds;
Expand Down Expand Up @@ -585,7 +585,7 @@ key_ref_t lookup_user_key(key_serial_t id, unsigned long lflags,

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:
Expand Down

0 comments on commit 4d09ec0

Please sign in to comment.