diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-12-11 19:59:38 +0000 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2014-12-16 18:05:20 +1100 |
commit | 5057975ae38452679b964f1382c5efcb9faee74e (patch) | |
tree | 7fcc2d43a583e598ccdd94db4171407dbbab19b6 /security | |
parent | d0bffab0439fb7edaee09677b636eef5991e8b80 (diff) | |
download | linux-stable-5057975ae38452679b964f1382c5efcb9faee74e.tar.gz linux-stable-5057975ae38452679b964f1382c5efcb9faee74e.tar.bz2 linux-stable-5057975ae38452679b964f1382c5efcb9faee74e.zip |
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')
-rw-r--r-- | security/keys/key.c | 10 |
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); |