[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <F35C793E-7CBA-4631-8928-C34D5B39F148@dilger.ca>
Date: Fri, 5 Nov 2010 01:02:13 -0600
From: Andreas Dilger <adilger.kernel@...ger.ca>
To: Joe Perches <joe@...ches.com>
Cc: Jiri Kosina <trivial@...nel.org>, Theodore Ts'o <tytso@....edu>,
Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 37/49] fs/ext4: Use vzalloc
On 2010-11-04, at 21:08, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@...ches.com>
> @@ -1909,9 +1909,7 @@ static int ext4_fill_flex_info(struct super_block *sb)
> size = flex_group_count * sizeof(struct flex_groups);
> sbi->s_flex_groups = kzalloc(size, GFP_KERNEL);
> if (sbi->s_flex_groups == NULL) {
> - sbi->s_flex_groups = vmalloc(size);
> - if (sbi->s_flex_groups)
> - memset(sbi->s_flex_groups, 0, size);
> + sbi->s_flex_groups = vzalloc(size);
> }
> if (sbi->s_flex_groups == NULL) {
> ext4_msg(sb, KERN_ERR, "not enough memory for "
You may as well move the second s_flex_groups == NULL check inside the first one:
if (sbi->s_flex_groups == NULL) {
sbi->s_flex_groups = vzalloc(size);
if (sbi->s_flex_groups == NULL) {
ext4_msg(sb, KERN_ERR, "not enough memory for "
"%u flex groups", flex_group_count);
goto failed;
}
}
Cheers, Andreas
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists