Skip to content

Commit

Permalink
cifs: fix filp leak in cifs_atomic_open()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miklos Szeredi authored and Al Viro committed Sep 16, 2013
1 parent 0854d45 commit dfb1d61
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/cifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit dfb1d61

Please sign in to comment.