All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel: auditfilter: replace kmalloc+memset with kzalloc
@ 2011-07-01  8:21 Chris Forbes
  2011-07-01  8:53 ` Américo Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Forbes @ 2011-07-01  8:21 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-kernel, Chris Forbes

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kernel: auditfilter: replace kmalloc+memset with kzalloc
  2011-07-01  8:21 [PATCH] kernel: auditfilter: replace kmalloc+memset with kzalloc Chris Forbes
@ 2011-07-01  8:53 ` Américo Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Américo Wang @ 2011-07-01  8:53 UTC (permalink / raw)
  To: Chris Forbes; +Cc: Al Viro, linux-kernel

On Fri, Jul 1, 2011 at 4:21 PM, Chris Forbes <chrisf@ijw.co.nz> wrote:
> Replaced a kmalloc+memset pair with a single call to kzalloc.
>
> Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>

Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-01  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-01  8:21 [PATCH] kernel: auditfilter: replace kmalloc+memset with kzalloc Chris Forbes
2011-07-01  8:53 ` Américo Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.