Skip to contentSkip to conversation

f2fs: move error condition for mkdir at proper place

PATCH In review Namjae Jeon 1 participant 1 message Dec 1, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 6/6 f2fs: move error condition for mkdir at proper place

From: Namjae Jeon <[email protected]>

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.

---
 fs/f2fs/namei.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/f2fs/namei.c +1 -2
index 63efd77..2d720ca 100644
@@ -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;
Signature · 1 line
1.7.9.5