summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorBurman Yan <yan_952@hotmail.com>2006-12-06 20:38:51 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 08:39:41 -0800
commit4668edc334ee90cf50c382c3e423cfc510b5a126 (patch)
treeee25ca93e72031f7f333b6c251a57a55ef089c90 /kernel
parent304e61e6fbadec586dfe002b535f169a04248e49 (diff)
downloadop-kernel-dev-4668edc334ee90cf50c382c3e423cfc510b5a126.zip
op-kernel-dev-4668edc334ee90cf50c382c3e423cfc510b5a126.tar.gz
[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.c3
-rw-r--r--kernel/futex.c3
-rw-r--r--kernel/kexec.c3
3 files changed, 3 insertions, 6 deletions
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 4f40d92..2e896f8 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)
struct audit_rule *rule;
int i;
- rule = kmalloc(sizeof(*rule), GFP_KERNEL);
+ rule = kzalloc(sizeof(*rule), GFP_KERNEL);
if (unlikely(!rule))
return NULL;
- memset(rule, 0, sizeof(*rule));
rule->flags = krule->flags | krule->listnr;
rule->action = krule->action;
diff --git a/kernel/futex.c b/kernel/futex.c
index af7b81c..7c0d0d4 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -324,12 +324,11 @@ static int refill_pi_state_cache(void)
if (likely(current->pi_state_cache))
return 0;
- pi_state = kmalloc(sizeof(*pi_state), GFP_KERNEL);
+ pi_state = kzalloc(sizeof(*pi_state), GFP_KERNEL);
if (!pi_state)
return -ENOMEM;
- memset(pi_state, 0, sizeof(*pi_state));
INIT_LIST_HEAD(&pi_state->list);
/* pi_mutex gets initialized later */
pi_state->owner = NULL;
diff --git a/kernel/kexec.c b/kernel/kexec.c
index fcdd5d2..d43692c 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -108,11 +108,10 @@ static int do_kimage_alloc(struct kimage **rimage, unsigned long entry,
/* Allocate a controlling structure */
result = -ENOMEM;
- image = kmalloc(sizeof(*image), GFP_KERNEL);
+ image = kzalloc(sizeof(*image), GFP_KERNEL);
if (!image)
goto out;
- memset(image, 0, sizeof(*image));
image->head = 0;
image->entry = &image->head;
image->last_entry = &image->head;
OpenPOWER on IntegriCloud