Skip to content

Commit dfb1d61

Browse files
Miklos SzerediAl Viro
authored andcommitted
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>
1 parent 0854d45 commit dfb1d61

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/cifs/dir.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
500500
if (server->ops->close)
501501
server->ops->close(xid, tcon, &fid);
502502
cifs_del_pending_open(&open);
503+
fput(file);
503504
rc = -ENOMEM;
504505
}
505506

0 commit comments

Comments
 (0)