summaryrefslogtreecommitdiffstats
path: root/security/selinux/netif.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2005-10-30 14:59:21 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 17:37:11 -0800
commit89d155ef62e5e0c10e4b37aaa5056f0beafe10e6 (patch)
tree7de1f357efd619000970526ca2688f79b9022417 /security/selinux/netif.c
parent0d078f6f96809c95c69b99d6605a502b0ac63d3d (diff)
downloadop-kernel-dev-89d155ef62e5e0c10e4b37aaa5056f0beafe10e6.zip
op-kernel-dev-89d155ef62e5e0c10e4b37aaa5056f0beafe10e6.tar.gz
[PATCH] SELinux: convert to kzalloc
This patch converts SELinux code from kmalloc/memset to the new kazalloc unction. On i386, this results in a text saving of over 1K. Before: text data bss dec hex filename 86319 4642 15236 106197 19ed5 security/selinux/built-in.o After: text data bss dec hex filename 85278 4642 15236 105156 19ac4 security/selinux/built-in.o Signed-off-by: James Morris <jmorris@namei.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'security/selinux/netif.c')
-rw-r--r--security/selinux/netif.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/security/selinux/netif.c b/security/selinux/netif.c
index 718d7be..b10c34e 100644
--- a/security/selinux/netif.c
+++ b/security/selinux/netif.c
@@ -114,13 +114,12 @@ static struct sel_netif *sel_netif_lookup(struct net_device *dev)
if (likely(netif != NULL))
goto out;
- new = kmalloc(sizeof(*new), GFP_ATOMIC);
+ new = kzalloc(sizeof(*new), GFP_ATOMIC);
if (!new) {
netif = ERR_PTR(-ENOMEM);
goto out;
}
- memset(new, 0, sizeof(*new));
nsec = &new->nsec;
ret = security_netif_sid(dev->name, &nsec->if_sid, &nsec->msg_sid);
OpenPOWER on IntegriCloud