[PATCH] kernel: auditfilter: replace kmalloc+memset with kzalloc

From: Chris Forbes
Date: Fri Jul 01 2011 - 04:22:39 EST


Replaced a kmalloc+memset pair with a single call to kzalloc.

Signed-off-by: Chris Forbes <chrisf@xxxxxxxxx>
---
kernel/auditfilter.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index f8277c8..d0af29d 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -603,10 +603,9 @@ static struct audit_rule_data *audit_krule_to_data(struct audit_krule *krule)
void *bufp;
int i;

- data = kmalloc(sizeof(*data) + krule->buflen, GFP_KERNEL);
+ data = kzalloc(sizeof(*data) + krule->buflen, GFP_KERNEL);
if (unlikely(!data))
return NULL;
- memset(data, 0, sizeof(*data));

data->flags = krule->flags | krule->listnr;
data->action = krule->action;
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/