aboutsummaryrefslogtreecommitdiff
path: root/security/selinux/ss/hashtab.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-11-05 14:38:55 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-11-05 14:38:55 -0500
commit328198acb7407301ddf6005c0fa1e04bd0c539c8 (patch)
tree9936112bd195bfbaacc9a75f2ea7ff757a2c0546 /security/selinux/ss/hashtab.c
parent9e0cb06b17be7e562cbdaba2768649f025826dc6 (diff)
parentfecb4a0c87c2bcaee1f3cf800126eef752a07ed3 (diff)
Merge branch 'master'
Diffstat (limited to 'security/selinux/ss/hashtab.c')
-rw-r--r--security/selinux/ss/hashtab.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/security/selinux/ss/hashtab.c b/security/selinux/ss/hashtab.c
index 26661fcc00c..24e5ec95763 100644
--- a/security/selinux/ss/hashtab.c
+++ b/security/selinux/ss/hashtab.c
@@ -15,11 +15,10 @@ struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, void *key),
struct hashtab *p;
u32 i;
- p = kmalloc(sizeof(*p), GFP_KERNEL);
+ p = kzalloc(sizeof(*p), GFP_KERNEL);
if (p == NULL)
return p;
- memset(p, 0, sizeof(*p));
p->size = size;
p->nel = 0;
p->hash_value = hash_value;
@@ -55,10 +54,9 @@ int hashtab_insert(struct hashtab *h, void *key, void *datum)
if (cur && (h->keycmp(h, key, cur->key) == 0))
return -EEXIST;
- newnode = kmalloc(sizeof(*newnode), GFP_KERNEL);
+ newnode = kzalloc(sizeof(*newnode), GFP_KERNEL);
if (newnode == NULL)
return -ENOMEM;
- memset(newnode, 0, sizeof(*newnode));
newnode->key = key;
newnode->datum = datum;
if (prev) {