提交 e0795cf4 编写于 作者: J Jesper Juhl 提交者: Linus Torvalds

[PATCH] selinux: Remove unneeded k[cm]alloc() return value casts

Remove redundant casts of k*alloc() return values in
security/selinux/ss/services.c
Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
Acked-by: NStephen Smalley <sds@epoch.ncsc.mil>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 792db3af
......@@ -1712,11 +1712,11 @@ int security_get_bools(int *len, char ***names, int **values)
goto out;
}
*names = (char**)kcalloc(*len, sizeof(char*), GFP_ATOMIC);
*names = kcalloc(*len, sizeof(char*), GFP_ATOMIC);
if (!*names)
goto err;
*values = (int*)kcalloc(*len, sizeof(int), GFP_ATOMIC);
*values = kcalloc(*len, sizeof(int), GFP_ATOMIC);
if (!*values)
goto err;
......@@ -1724,7 +1724,7 @@ int security_get_bools(int *len, char ***names, int **values)
size_t name_len;
(*values)[i] = policydb.bool_val_to_struct[i]->state;
name_len = strlen(policydb.p_bool_val_to_name[i]) + 1;
(*names)[i] = (char*)kmalloc(sizeof(char) * name_len, GFP_ATOMIC);
(*names)[i] = kmalloc(sizeof(char) * name_len, GFP_ATOMIC);
if (!(*names)[i])
goto err;
strncpy((*names)[i], policydb.p_bool_val_to_name[i], name_len);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册