diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jffs2/build.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/jffs2/build.c b/fs/jffs2/build.c index 85c6be2db02f..3005ec4520ad 100644 --- a/fs/jffs2/build.c +++ b/fs/jffs2/build.c | |||
@@ -336,14 +336,13 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c) | |||
336 | size = sizeof(struct jffs2_eraseblock) * c->nr_blocks; | 336 | size = sizeof(struct jffs2_eraseblock) * c->nr_blocks; |
337 | #ifndef __ECOS | 337 | #ifndef __ECOS |
338 | if (jffs2_blocks_use_vmalloc(c)) | 338 | if (jffs2_blocks_use_vmalloc(c)) |
339 | c->blocks = vmalloc(size); | 339 | c->blocks = vzalloc(size); |
340 | else | 340 | else |
341 | #endif | 341 | #endif |
342 | c->blocks = kmalloc(size, GFP_KERNEL); | 342 | c->blocks = kzalloc(size, GFP_KERNEL); |
343 | if (!c->blocks) | 343 | if (!c->blocks) |
344 | return -ENOMEM; | 344 | return -ENOMEM; |
345 | 345 | ||
346 | memset(c->blocks, 0, size); | ||
347 | for (i=0; i<c->nr_blocks; i++) { | 346 | for (i=0; i<c->nr_blocks; i++) { |
348 | INIT_LIST_HEAD(&c->blocks[i].list); | 347 | INIT_LIST_HEAD(&c->blocks[i].list); |
349 | c->blocks[i].offset = i * c->sector_size; | 348 | c->blocks[i].offset = i * c->sector_size; |