瀏覽代碼

clean up the failure exits in cifs_read_super()

no need to make that iput() conditional, just take it to the right place...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro 13 年之前
父節點
當前提交
064326c077
共有 1 個文件被更改,包括 1 次插入4 次删除
  1. 1 4
      fs/cifs/cifsfs.c

+ 1 - 4
fs/cifs/cifsfs.c

@@ -119,7 +119,6 @@ cifs_read_super(struct super_block *sb)
 
 	if (IS_ERR(inode)) {
 		rc = PTR_ERR(inode);
-		inode = NULL;
 		goto out_no_root;
 	}
 
@@ -127,6 +126,7 @@ cifs_read_super(struct super_block *sb)
 
 	if (!sb->s_root) {
 		rc = -ENOMEM;
+		iput(inode);
 		goto out_no_root;
 	}
 
@@ -147,9 +147,6 @@ cifs_read_super(struct super_block *sb)
 
 out_no_root:
 	cERROR(1, "cifs_read_super: get root inode failed");
-	if (inode)
-		iput(inode);
-
 	return rc;
 }