Commit 5057975a authored by Dan Carpenter's avatar Dan Carpenter Committed by James Morris

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
parent d0bffab0
...@@ -276,12 +276,10 @@ struct key *key_alloc(struct key_type *type, const char *desc, ...@@ -276,12 +276,10 @@ struct key *key_alloc(struct key_type *type, const char *desc,
if (!key) if (!key)
goto no_memory_2; goto no_memory_2;
if (desc) { key->index_key.desc_len = desclen;
key->index_key.desc_len = desclen; key->index_key.description = kmemdup(desc, desclen + 1, GFP_KERNEL);
key->index_key.description = kmemdup(desc, desclen + 1, GFP_KERNEL); if (!key->description)
if (!key->description) goto no_memory_3;
goto no_memory_3;
}
atomic_set(&key->usage, 1); atomic_set(&key->usage, 1);
init_rwsem(&key->sem); init_rwsem(&key->sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment