summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2013-09-16 14:51:59 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2013-09-17 01:17:24 +0200
commitdfb1d61b0e9f9e2c542e9adc8d970689f4114ff6 (patch)
tree7cb3e3a9742cee2298e90db10d1f07b517cf66c8 /fs/cifs
parentvfs: improve i_op->atomic_open() documentation (diff)
downloadlinux-dfb1d61b0e9f9e2c542e9adc8d970689f4114ff6.tar.xz
linux-dfb1d61b0e9f9e2c542e9adc8d970689f4114ff6.zip
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>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/dir.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index d3e2eaa503a6..5384c2a640ca 100644
--- a/fs/cifs/dir.c
+++ b/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;
}