]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: Propagate error code instead of returning -EINVAL
authorDan Carpenter <error27@gmail.com>
Fri, 11 Jun 2010 16:30:05 +0000 (17:30 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 27 Jun 2010 14:02:34 +0000 (07:02 -0700)
commitc803b2662f040d30a7e923295602769c1f35fcbb
tree83e649d3b9d3583c7576920a0feb08e38a19d1b5
parenta05552eb058caba6e4fae1ea274cb90883c6f8eb
KEYS: Propagate error code instead of returning -EINVAL

This is from a Smatch check I'm writing.

strncpy_from_user() returns -EFAULT on error so the first change just
silences a warning but doesn't change how the code works.

The other change is a bug fix because install_thread_keyring_to_cred()
can return a variety of errors such as -EINVAL, -EEXIST, -ENOMEM or
-EKEYREVOKED.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
security/keys/keyctl.c