Patchwork [16/25] e2fsck: remove extraneous memset

login
register
mail settings
Submitter Eric Sandeen
Date Sept. 16, 2011, 8:49 p.m.
Message ID <1316206180-6375-17-git-send-email-sandeen@redhat.com>
Download mbox | patch
Permalink /patch/115043/
State Accepted
Headers show

Comments

Eric Sandeen - Sept. 16, 2011, 8:49 p.m.
e2fsck_allocate_memory() already sets allocated memory to 0,
so remove the explicit memset.

Especially since it was setting the wrong size (iter not *iter)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 e2fsck/dirinfo.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
Theodore Ts'o - Sept. 16, 2011, 10:56 p.m.
On Fri, Sep 16, 2011 at 03:49:31PM -0500, Eric Sandeen wrote:
> e2fsck_allocate_memory() already sets allocated memory to 0,
> so remove the explicit memset.
> 
> Especially since it was setting the wrong size (iter not *iter)
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Applied, thanks.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/e2fsck/dirinfo.c b/e2fsck/dirinfo.c
index 901235c..ace5b4d 100644
--- a/e2fsck/dirinfo.c
+++ b/e2fsck/dirinfo.c
@@ -318,7 +318,6 @@  extern struct dir_info_iter *e2fsck_dir_info_iter_begin(e2fsck_t ctx)
 
 	iter = e2fsck_allocate_memory(ctx, sizeof(struct dir_info_iter),
 				      "dir_info iterator");
-	memset(iter, 0, sizeof(iter));
 
 	if (db->tdb)
 		iter->tdb_iter = tdb_firstkey(db->tdb);