Research Menu

.
Skip Search Box

SELinux Mailing List

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

From: Jesper Juhl <jesper.juhl_at_gmail.com>
Date: Sun, 11 Dec 2005 20:35:02 +0100

Remove redundant casts of k*alloc() return values in security/selinux/ss/services.c

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>

---

 security/selinux/ss/services.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.15-rc5-git1-orig/security/selinux/ss/services.c	2005-12-04 18:49:02.000000000 +0100
+++ linux-2.6.15-rc5-git1/security/selinux/ss/services.c	2005-12-11 19:46:39.000000000 +0100
@@ -1712,11 +1712,11 @@ int security_get_bools(int *len, char **
 		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 ** 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); -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with the words "unsubscribe selinux" without quotes as the message.
Received on Tue 13 Dec 2005 - 10:11:43 EST
 

Date Posted: Jan 15, 2009 | Last Modified: Jan 15, 2009 | Last Reviewed: Jan 15, 2009

 
bottom

National Security Agency / Central Security Service