mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selinux: Casting (void *) value returned by kmalloc is useless
@ 2011-11-17 22:43 Thomas Meyer
  2011-12-19  0:24 ` James Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Meyer @ 2011-11-17 22:43 UTC (permalink / raw)
  To: linux-security-module, linux-kernel

The semantic patch that makes this change is available
in scripts/coccinelle/api/alloc/drop_kmalloc_cast.cocci.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c
--- a/security/selinux/ss/conditional.c 2011-11-07 19:38:36.047349083 +0100
+++ b/security/selinux/ss/conditional.c 2011-11-08 09:16:49.914488441 +0100
@@ -175,7 +175,7 @@ void cond_policydb_destroy(struct policy
 int cond_init_bool_indexes(struct policydb *p)
 {
 	kfree(p->bool_val_to_struct);
-	p->bool_val_to_struct = (struct cond_bool_datum **)
+	p->bool_val_to_struct =
 		kmalloc(p->p_bools.nprim * sizeof(struct cond_bool_datum *), GFP_KERNEL);
 	if (!p->bool_val_to_struct)
 		return -ENOMEM;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-19  0:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-17 22:43 [PATCH] selinux: Casting (void *) value returned by kmalloc is useless Thomas Meyer
2011-12-19  0:24 ` James Morris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®