[PATCH] CIFS: Fix error code in smb311_posix_mkdir()

Dan Carpenter dan.carpenter at oracle.com
Thu Jun 21 15:01:03 UTC 2018


The error assignment needs to go before the goto.

Fixes: 5539e9b24a38 ("CIFS: fix memory leak and remove dead code")
Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 062a2a59beb3..c9489b1160f0 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1946,8 +1946,8 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
 	if (ses && (ses->server))
 		server = ses->server;
 	else {
-		goto err_free_path;
 		rc = -EIO;
+		goto err_free_path;
 	}
 
 	/* resource #2: request */



More information about the samba-technical mailing list