aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-12-11 14:59:38 -0500
committerJames Morris <james.l.morris@oracle.com>2014-12-16 02:05:20 -0500
commit5057975ae38452679b964f1382c5efcb9faee74e (patch)
tree7fcc2d43a583e598ccdd94db4171407dbbab19b6 /security/keys
parentd0bffab0439fb7edaee09677b636eef5991e8b80 (diff)
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')
-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,
276 if (!key) 276 if (!key)
277 goto no_memory_2; 277 goto no_memory_2;
278 278
279 if (desc) { 279 key->index_key.desc_len = desclen;
280 key->index_key.desc_len = desclen; 280 key->index_key.description = kmemdup(desc, desclen + 1, GFP_KERNEL);
281 key->index_key.description = kmemdup(desc, desclen + 1, GFP_KERNEL); 281 if (!key->description)
282 if (!key->description) 282 goto no_memory_3;
283 goto no_memory_3;
284 }
285 283
286 atomic_set(&key->usage, 1); 284 atomic_set(&key->usage, 1);
287 init_rwsem(&key->sem); 285 init_rwsem(&key->sem);