瀏覽代碼

cifs: fix filp leak in cifs_atomic_open()

If an error occurs after having called finish_open() then fput() needs to
be called on the already opened file.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Steve French <sfrench@samba.org>
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Miklos Szeredi 12 年之前
父節點
當前提交
dfb1d61b0e
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      fs/cifs/dir.c

+ 1 - 0
fs/cifs/dir.c

@@ -500,6 +500,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
 		if (server->ops->close)
 			server->ops->close(xid, tcon, &fid);
 		cifs_del_pending_open(&open);
+		fput(file);
 		rc = -ENOMEM;
 	}