提交 4d09ec0f 编写于 作者: D Dan Carpenter 提交者: James Morris

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: NDan Carpenter <error27@gmail.com>
Signed-off-by: NDavid Howells <dhowells@redhat.com>
Signed-off-by: NJames Morris <jmorris@namei.org>
上级 c80901f2
......@@ -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;
......@@ -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;
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册