All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen@asianux.com>
To: jack@suse.cz, akpm@linux-foundation.org
Cc: linux-ext4@vger.kernel.org
Subject: [PATCH] fs/ext3: use kzalloc instead of kmalloc
Date: Mon, 24 Dec 2012 13:28:53 +0800	[thread overview]
Message-ID: <50D7E815.6050503@asianux.com> (raw)


  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

             reply	other threads:[~2012-12-24  5:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-24  5:28 Chen Gang [this message]
2012-12-25 18:48 ` [PATCH] fs/ext3: use kzalloc instead of kmalloc 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

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=50D7E815.6050503@asianux.com \
    --to=gang.chen@asianux.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    /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 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.