Thread (3 messages) 3 messages, 3 authors, 2013-09-18

Re: [PATCH 05/11] cifs: fix filp leak in cifs_atomic_open()

From: Steve French <smfrench@gmail.com>
Date: 2013-09-18 15:19:25
Also in: linux-fsdevel, lkml

Do you want me to merge this via my tree (cifs-2.6.git) or another?

On Mon, Sep 16, 2013 at 7:51 AM, Miklos Szeredi [off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Miklos Szeredi <redacted>

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 <redacted>
Cc: Steve French <sfrench@samba.org>
Cc: stable@vger.kernel.org
---
 fs/cifs/dir.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index d3e2eaa..5384c2a 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;
        }

--
1.8.1.4


-- 
Thanks,

Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help