Explorar o código

KEYS: Return more accurate error codes

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>
Dan Carpenter %!s(int64=15) %!d(string=hai) anos
pai
achega
4d09ec0f70
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      security/keys/process_keys.c

+ 3 - 3
security/keys/process_keys.c

@@ -508,7 +508,7 @@ try_again:
 
 
 			ret = install_thread_keyring();
 			ret = install_thread_keyring();
 			if (ret < 0) {
 			if (ret < 0) {
-				key = ERR_PTR(ret);
+				key_ref = ERR_PTR(ret);
 				goto error;
 				goto error;
 			}
 			}
 			goto reget_creds;
 			goto reget_creds;
@@ -526,7 +526,7 @@ try_again:
 
 
 			ret = install_process_keyring();
 			ret = install_process_keyring();
 			if (ret < 0) {
 			if (ret < 0) {
-				key = ERR_PTR(ret);
+				key_ref = ERR_PTR(ret);
 				goto error;
 				goto error;
 			}
 			}
 			goto reget_creds;
 			goto reget_creds;
@@ -585,7 +585,7 @@ try_again:
 
 
 	case KEY_SPEC_GROUP_KEYRING:
 	case KEY_SPEC_GROUP_KEYRING:
 		/* group keyrings are not yet supported */
 		/* group keyrings are not yet supported */
-		key = ERR_PTR(-EINVAL);
+		key_ref = ERR_PTR(-EINVAL);
 		goto error;
 		goto error;
 
 
 	case KEY_SPEC_REQKEY_AUTH_KEY:
 	case KEY_SPEC_REQKEY_AUTH_KEY: