From: Dan Carpenter Date: Mon, 17 May 2010 13:42:35 +0000 (+0100) Subject: KEYS: Return more accurate error codes X-Git-Tag: v2.6.32.16~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ec098d1914879ce1fb45691f33c8cd194eef7a50;p=karo-tx-linux.git 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 Signed-off-by: David Howells Signed-off-by: James Morris Signed-off-by: Greg Kroah-Hartman --- 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: