]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.11.3/cifs-fix-filp-leak-in-cifs_atomic_open.patch
Linux 4.14.109
[thirdparty/kernel/stable-queue.git] / releases / 3.11.3 / cifs-fix-filp-leak-in-cifs_atomic_open.patch
1 From dfb1d61b0e9f9e2c542e9adc8d970689f4114ff6 Mon Sep 17 00:00:00 2001
2 From: Miklos Szeredi <mszeredi@suse.cz>
3 Date: Mon, 16 Sep 2013 14:51:59 +0200
4 Subject: cifs: fix filp leak in cifs_atomic_open()
5
6 From: Miklos Szeredi <mszeredi@suse.cz>
7
8 commit dfb1d61b0e9f9e2c542e9adc8d970689f4114ff6 upstream.
9
10 If an error occurs after having called finish_open() then fput() needs to
11 be called on the already opened file.
12
13 Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
14 Cc: Steve French <sfrench@samba.org>
15 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17
18 ---
19 fs/cifs/dir.c | 1 +
20 1 file changed, 1 insertion(+)
21
22 --- a/fs/cifs/dir.c
23 +++ b/fs/cifs/dir.c
24 @@ -499,6 +499,7 @@ cifs_atomic_open(struct inode *inode, st
25 if (server->ops->close)
26 server->ops->close(xid, tcon, &fid);
27 cifs_del_pending_open(&open);
28 + fput(file);
29 rc = -ENOMEM;
30 }
31