From patchwork Fri Nov 30 06:41:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/4] ext4: remove unsafe and unnecessary memset() Date: Thu, 29 Nov 2012 20:41:43 -0000 From: Guo Chao X-Patchwork-Id: 202878 Message-Id: <1354257706-6582-1-git-send-email-yan@linux.vnet.ibm.com> To: tytso@mit.edu Cc: linux-ext4@vger.kernel.org We memset this page before checking whether it's valid. But we need not memset zeroed page at all. Signed-off-by: Guo Chao Reviewed-by: Lukas Czerner --- fs/ext4/super.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ad6cd8a..66a4e20 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3206,7 +3206,6 @@ int ext4_calculate_overhead(struct super_block *sb) ext4_fsblk_t overhead = 0; char *buf = (char *) get_zeroed_page(GFP_KERNEL); - memset(buf, 0, PAGE_SIZE); if (!buf) return -ENOMEM;