Skip to content

Commit

Permalink
[PATCH] jffs: replace kmalloc+memset with kzalloc
Browse files Browse the repository at this point in the history
Replace kmalloc+memset with kzalloc

Signed-off-by: Yan Burman <burman.yan@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
yanburman authored and Linus Torvalds committed Dec 7, 2006
1 parent a0172a6 commit 4a08a9f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/jffs/intrep.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ jffs_add_virtual_root(struct jffs_control *c)
D2(printk("jffs_add_virtual_root(): "
"Creating a virtual root directory.\n"));

if (!(root = kmalloc(sizeof(struct jffs_file), GFP_KERNEL))) {
if (!(root = kzalloc(sizeof(struct jffs_file), GFP_KERNEL))) {
return -ENOMEM;
}
no_jffs_file++;
Expand All @@ -604,7 +604,6 @@ jffs_add_virtual_root(struct jffs_control *c)
DJM(no_jffs_node++);
memset(node, 0, sizeof(struct jffs_node));
node->ino = JFFS_MIN_INO;
memset(root, 0, sizeof(struct jffs_file));
root->ino = JFFS_MIN_INO;
root->mode = S_IFDIR | S_IRWXU | S_IRGRP
| S_IXGRP | S_IROTH | S_IXOTH;
Expand Down

0 comments on commit 4a08a9f

Please sign in to comment.