]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
cifs: fix filp leak in cifs_atomic_open()
authorMiklos Szeredi <mszeredi@suse.cz>
Mon, 16 Sep 2013 12:51:59 +0000 (14:51 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 16 Sep 2013 23:17:24 +0000 (19:17 -0400)
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>
fs/cifs/dir.c

index d3e2eaa503a631e90d918d8ae1d3c9cc2bb66cda..5384c2a640ca6fc06962a01261ca4f8ce890b246 100644 (file)
@@ -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;
        }