提交 5057975a 编写于 作者: D Dan Carpenter 提交者: 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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDavid Howells <dhowells@redhat.com>
Signed-off-by: NJames Morris <james.l.morris@oracle.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册