linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/ext3: use kzalloc instead of kmalloc
@ 2012-12-24  5:28 Chen Gang
  2012-12-25 18:48 ` Theodore Ts'o
  0 siblings, 1 reply; 6+ messages in thread
From: Chen Gang @ 2012-12-24  5:28 UTC (permalink / raw)
  To: jack, akpm; +Cc: linux-ext4


  better to use kzalloc instead of kmalloc.
    if acl_e->e_tag is neither ACL_USER, nor ACL_GROUP.
    entry->e_id will not be initialized

  we can not say it is a bug, but suggest to initialize it, too.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 fs/ext3/acl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index dbb5ad5..5121c5b 100644
--- a/fs/ext3/acl.c
+++ b/fs/ext3/acl.c
@@ -91,7 +91,7 @@ ext3_acl_to_disk(const struct posix_acl *acl, size_t *size)
 	size_t n;
 
 	*size = ext3_acl_size(acl->a_count);
-	ext_acl = kmalloc(sizeof(ext3_acl_header) + acl->a_count *
+	ext_acl = kzalloc(sizeof(ext3_acl_header) + acl->a_count *
 			sizeof(ext3_acl_entry), GFP_NOFS);
 	if (!ext_acl)
 		return ERR_PTR(-ENOMEM);
-- 
1.7.10.4

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

end of thread, other threads:[~2012-12-26  5:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-24  5:28 [PATCH] fs/ext3: use kzalloc instead of kmalloc Chen Gang
2012-12-25 18:48 ` Theodore Ts'o
2012-12-26  3:15   ` Chen Gang
2012-12-26  4:45     ` Theodore Ts'o
2012-12-26  5:08       ` Chen Gang
2012-12-26  5:34         ` Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).