Skip to content

Commit

Permalink
befs: replace kmalloc/memset 0 by kzalloc
Browse files Browse the repository at this point in the history
Use kzalloc for clean fs_info allocation like other filesystems.

Signed-off-by: Fabian Frederick <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Fabian Frederick authored and torvalds committed Apr 3, 2014
1 parent 84ee353 commit 2d4319e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/befs/linuxvfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,15 +791,14 @@ befs_fill_super(struct super_block *sb, void *data, int silent)

save_mount_options(sb, data);

sb->s_fs_info = kmalloc(sizeof (*befs_sb), GFP_KERNEL);
sb->s_fs_info = kzalloc(sizeof(*befs_sb), GFP_KERNEL);
if (sb->s_fs_info == NULL) {
printk(KERN_ERR
"BeFS(%s): Unable to allocate memory for private "
"portion of superblock. Bailing.\n", sb->s_id);
goto unacquire_none;
}
befs_sb = BEFS_SB(sb);
memset(befs_sb, 0, sizeof(befs_sb_info));

if (!parse_options((char *) data, &befs_sb->mount_opts)) {
befs_error(sb, "cannot parse mount options");
Expand Down

0 comments on commit 2d4319e

Please sign in to comment.