aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/hashtab.c
diff options
context:
space:
mode:
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 26661fcc00ce..24e5ec957630 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),
15 struct hashtab *p; 15 struct hashtab *p;
16 u32 i; 16 u32 i;
17 17
18 p = kmalloc(sizeof(*p), GFP_KERNEL); 18 p = kzalloc(sizeof(*p), GFP_KERNEL);
19 if (p == NULL) 19 if (p == NULL)
20 return p; 20 return p;
21 21
22 memset(p, 0, sizeof(*p));
23 p->size = size; 22 p->size = size;
24 p->nel = 0; 23 p->nel = 0;
25 p->hash_value = hash_value; 24 p->hash_value = hash_value;
@@ -55,10 +54,9 @@ int hashtab_insert(struct hashtab *h, void *key, void *datum)
55 if (cur && (h->keycmp(h, key, cur->key) == 0)) 54 if (cur && (h->keycmp(h, key, cur->key) == 0))
56 return -EEXIST; 55 return -EEXIST;
57 56
58 newnode = kmalloc(sizeof(*newnode), GFP_KERNEL); 57 newnode = kzalloc(sizeof(*newnode), GFP_KERNEL);
59 if (newnode == NULL) 58 if (newnode == NULL)
60 return -ENOMEM; 59 return -ENOMEM;
61 memset(newnode, 0, sizeof(*newnode));
62 newnode->key = key; 60 newnode->key = key;
63 newnode->datum = datum; 61 newnode->datum = datum;
64 if (prev) { 62 if (prev) {