CIFS: Fix a wrong pointer in atomic_open
authorPavel Shilovsky <pshilovsky@samba.org>
Mon, 9 Jul 2012 12:09:23 +0000 (16:09 +0400)
committerPavel Shilovsky <pshilovsky@samba.org>
Tue, 24 Jul 2012 17:54:26 +0000 (21:54 +0400)
Commit 30d904947459cca2beb69e0110716f5248b31f2a caused a regression
in cifs open codepath.

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/dir.c

index d364654491e33e2648518461fa6c6e2de8e88fae..2caba0b54acbec54381f60ab467ca82e263d6e58 100644 (file)
@@ -387,7 +387,6 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
        struct cifs_tcon *tcon;
        __u16 fileHandle;
        __u32 oplock;
-       struct file *filp;
        struct cifsFileInfo *pfile_info;
 
        /* Posix open is only called (at lookup time) for file create now.  For
@@ -418,7 +417,6 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
             inode, direntry->d_name.name, direntry);
 
        tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
-       filp = ERR_CAST(tlink);
        if (IS_ERR(tlink))
                goto out_free_xid;
 
@@ -436,10 +434,9 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
                goto out;
        }
 
-       pfile_info = cifs_new_fileinfo(fileHandle, filp, tlink, oplock);
+       pfile_info = cifs_new_fileinfo(fileHandle, file, tlink, oplock);
        if (pfile_info == NULL) {
                CIFSSMBClose(xid, tcon, fileHandle);
-               fput(filp);
                rc = -ENOMEM;
        }