summaryrefslogtreecommitdiffstats
path: root/security/keys/key.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-12-11 19:59:38 +0000
committerJames Morris <james.l.morris@oracle.com>2014-12-16 18:05:20 +1100
commit5057975ae38452679b964f1382c5efcb9faee74e (patch)
tree7fcc2d43a583e598ccdd94db4171407dbbab19b6 /security/keys/key.c
parentd0bffab0439fb7edaee09677b636eef5991e8b80 (diff)
downloadlinux-5057975ae38452679b964f1382c5efcb9faee74e.tar.bz2
KEYS: remove a bogus NULL check
We already checked if "desc" was NULL at the beginning of the function and we've dereferenced it so this causes a static checker warning. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
Diffstat (limited to 'security/keys/key.c')
-rw-r--r--security/keys/key.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/security/keys/key.c b/security/keys/key.c
index e17ba6aefdc0..aee2ec5a18fc 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -276,12 +276,10 @@ struct key *key_alloc(struct key_type *type, const char *desc,
if (!key)
goto no_memory_2;
- if (desc) {
- key->index_key.desc_len = desclen;
- key->index_key.description = kmemdup(desc, desclen + 1, GFP_KERNEL);
- if (!key->description)
- goto no_memory_3;
- }
+ key->index_key.desc_len = desclen;
+ key->index_key.description = kmemdup(desc, desclen + 1, GFP_KERNEL);
+ if (!key->description)
+ goto no_memory_3;
atomic_set(&key->usage, 1);
init_rwsem(&key->sem);