diff options
author | Burman Yan <yan_952@hotmail.com> | 2006-12-06 23:38:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:41 -0500 |
commit | 4668edc334ee90cf50c382c3e423cfc510b5a126 (patch) | |
tree | ee25ca93e72031f7f333b6c251a57a55ef089c90 /kernel | |
parent | 304e61e6fbadec586dfe002b535f169a04248e49 (diff) |
[PATCH] kernel core: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/auditfilter.c | 3 | ||||
-rw-r--r-- | kernel/futex.c | 3 | ||||
-rw-r--r-- | kernel/kexec.c | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index 4f40d923af8e..2e896f8ae29e 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c | |||
@@ -636,10 +636,9 @@ static struct audit_rule *audit_krule_to_rule(struct audit_krule *krule) | |||
636 | struct audit_rule *rule; | 636 | struct audit_rule *rule; |
637 | int i; | 637 | int i; |
638 | 638 | ||
639 | rule = kmalloc(sizeof(*rule), GFP_KERNEL); | 639 | rule = kzalloc(sizeof(*rule), GFP_KERNEL); |
640 | if (unlikely(!rule)) | 640 | if (unlikely(!rule)) |
641 | return NULL; | 641 | return NULL; |
642 | memset(rule, 0, sizeof(*rule)); | ||
643 | 642 | ||
644 | rule->flags = krule->flags | krule->listnr; | 643 | rule->flags = krule->flags | krule->listnr; |
645 | rule->action = krule->action; | 644 | rule->action = krule->action; |
diff --git a/kernel/futex.c b/kernel/futex.c index af7b81cbde30..7c0d0d4fa7f7 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -324,12 +324,11 @@ static int refill_pi_state_cache(void) | |||
324 | if (likely(current->pi_state_cache)) | 324 | if (likely(current->pi_state_cache)) |
325 | return 0; | 325 | return 0; |
326 | 326 | ||
327 | pi_state = kmalloc(sizeof(*pi_state), GFP_KERNEL); | 327 | pi_state = kzalloc(sizeof(*pi_state), GFP_KERNEL); |
328 | 328 | ||
329 | if (!pi_state) | 329 | if (!pi_state) |
330 | return -ENOMEM; | 330 | return -ENOMEM; |
331 | 331 | ||
332 | memset(pi_state, 0, sizeof(*pi_state)); | ||
333 | INIT_LIST_HEAD(&pi_state->list); | 332 | INIT_LIST_HEAD(&pi_state->list); |
334 | /* pi_mutex gets initialized later */ | 333 | /* pi_mutex gets initialized later */ |
335 | pi_state->owner = NULL; | 334 | pi_state->owner = NULL; |
diff --git a/kernel/kexec.c b/kernel/kexec.c index fcdd5d2bc3f4..d43692cf2321 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -108,11 +108,10 @@ static int do_kimage_alloc(struct kimage **rimage, unsigned long entry, | |||
108 | 108 | ||
109 | /* Allocate a controlling structure */ | 109 | /* Allocate a controlling structure */ |
110 | result = -ENOMEM; | 110 | result = -ENOMEM; |
111 | image = kmalloc(sizeof(*image), GFP_KERNEL); | 111 | image = kzalloc(sizeof(*image), GFP_KERNEL); |
112 | if (!image) | 112 | if (!image) |
113 | goto out; | 113 | goto out; |
114 | 114 | ||
115 | memset(image, 0, sizeof(*image)); | ||
116 | image->head = 0; | 115 | image->head = 0; |
117 | image->entry = &image->head; | 116 | image->entry = &image->head; |
118 | image->last_entry = &image->head; | 117 | image->last_entry = &image->head; |