CIFS: fix error return code in cifs_atomic_open()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 4 Apr 2013 06:16:21 +0000 (14:16 +0800)
committerSteve French <smfrench@gmail.com>
Sun, 5 May 2013 03:18:06 +0000 (22:18 -0500)
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/dir.c

index 46e455ece573b48b5717c8230e4088f7f106288b..5699b5036ed805189d367796d9a673730e773b8b 100644 (file)
@@ -457,8 +457,10 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
                 inode, direntry->d_name.name, direntry);
 
        tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
-       if (IS_ERR(tlink))
+       if (IS_ERR(tlink)) {
+               rc = PTR_ERR(tlink);
                goto out_free_xid;
+       }
 
        tcon = tlink_tcon(tlink);
        server = tcon->ses->server;