From: Miklos Szeredi Date: Mon, 16 Sep 2013 12:51:59 +0000 (+0200) Subject: cifs: fix filp leak in cifs_atomic_open() X-Git-Tag: v3.11.3~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03c58b665fd0ce5f0acc6ebcd3c3a0df586e05d3;p=thirdparty%2Fkernel%2Fstable.git cifs: fix filp leak in cifs_atomic_open() commit dfb1d61b0e9f9e2c542e9adc8d970689f4114ff6 upstream. 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 Cc: Steve French Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index d62ce0d481417..4c019f471ab77 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -499,6 +499,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; }