diff options
author | David Howells <dhowells@redhat.com> | 2012-05-15 14:11:11 +0100 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2012-05-16 00:54:33 +1000 |
commit | b404aef72fdafb601c945c714164c0ee2b04c364 (patch) | |
tree | 46efed0307e7c208a254614361bbe08ed160ef52 /include/linux/key.h | |
parent | 2cc8a71641b4460783ea3bd7a3476043fdf85397 (diff) | |
download | linux-b404aef72fdafb601c945c714164c0ee2b04c364.tar.gz linux-b404aef72fdafb601c945c714164c0ee2b04c364.tar.bz2 linux-b404aef72fdafb601c945c714164c0ee2b04c364.zip |
KEYS: Don't check for NULL key pointer in key_validate()
Don't bother checking for NULL key pointer in key_validate() as all of the
places that call it will crash anyway if the relevant key pointer is NULL by
the time they call key_validate(). Therefore, the checking must be done prior
to calling here.
Whilst we're at it, simplify the key_validate() function a bit and mark its
argument const.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
Diffstat (limited to 'include/linux/key.h')
-rw-r--r-- | include/linux/key.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/key.h b/include/linux/key.h index b145b054b3e0..5231800770e1 100644 --- a/include/linux/key.h +++ b/include/linux/key.h @@ -242,7 +242,7 @@ extern struct key *request_key_async_with_auxdata(struct key_type *type, extern int wait_for_key_construction(struct key *key, bool intr); -extern int key_validate(struct key *key); +extern int key_validate(const struct key *key); extern key_ref_t key_create_or_update(key_ref_t keyring, const char *type, |