summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2012-12-01 02:56:25 +0100
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2012-12-11 05:43:44 +0100
commit61412b64b965af72798000c3c921e88db31216b1 (patch)
tree8d078a7feb21c9a5bb4d7e1bbe479275671e543b /fs/f2fs
parentf2fs: remove unneeded initialization (diff)
downloadlinux-61412b64b965af72798000c3c921e88db31216b1.tar.xz
linux-61412b64b965af72798000c3c921e88db31216b1.zip
f2fs: move error condition for mkdir at proper place
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>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/namei.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 63efd77fab92..2d720ca47071 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -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;