From: Chris Forbes <chrisf@ijw.co.nz>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, Chris Forbes <chrisf@ijw.co.nz>
Subject: [PATCH] kernel: auditfilter: replace kmalloc+memset with kzalloc
Date: Fri, 1 Jul 2011 20:21:58 +1200 [thread overview]
Message-ID: <1309508518-23586-1-git-send-email-chrisf@ijw.co.nz> (raw)
Replaced a kmalloc+memset pair with a single call to kzalloc.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
---
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
next reply other threads:[~2011-07-01 8:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-01 8:21 Chris Forbes [this message]
2011-07-01 8:53 ` Américo Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1309508518-23586-1-git-send-email-chrisf@ijw.co.nz \
--to=chrisf@ijw.co.nz \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®