Skip to content

Commit

Permalink
f2fs: move error condition for mkdir at proper place
Browse files Browse the repository at this point in the history
In function f2fs_mkdir, err is being initialized without even checking
if there was any error in new inode creation. So, instead check the
inode error and make use of error/return condition.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
  • Loading branch information
Namjae Jeon authored and Jaegeuk Kim committed Dec 11, 2012
1 parent 1042d60 commit 61412b6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/f2fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,8 @@ static int f2fs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
int err;

inode = f2fs_new_inode(dir, S_IFDIR | mode);
err = PTR_ERR(inode);
if (IS_ERR(inode))
return err;
return PTR_ERR(inode);

inode->i_op = &f2fs_dir_inode_operations;
inode->i_fop = &f2fs_dir_operations;
Expand Down

0 comments on commit 61412b6

Please sign in to comment.