jffs2: use vzalloc
authorJoe Perches <joe@perches.com>
Fri, 5 Nov 2010 03:08:02 +0000 (20:08 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 3 Dec 2010 16:27:34 +0000 (16:27 +0000)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
fs/jffs2/build.c

index 85c6be2db02f7fc5c9b0152cc723ec39e6c25584..3005ec4520adf88314af781a956bae7ab1f04b22 100644 (file)
@@ -336,14 +336,13 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c)
        size = sizeof(struct jffs2_eraseblock) * c->nr_blocks;
 #ifndef __ECOS
        if (jffs2_blocks_use_vmalloc(c))
-               c->blocks = vmalloc(size);
+               c->blocks = vzalloc(size);
        else
 #endif
-               c->blocks = kmalloc(size, GFP_KERNEL);
+               c->blocks = kzalloc(size, GFP_KERNEL);
        if (!c->blocks)
                return -ENOMEM;
 
-       memset(c->blocks, 0, size);
        for (i=0; i<c->nr_blocks; i++) {
                INIT_LIST_HEAD(&c->blocks[i].list);
                c->blocks[i].offset = i * c->sector_size;