diff mbox series

CIFS: Fix error code in smb311_posix_mkdir()

Message ID 20180621150103.2zl7be4yzzotnqgw@kili.mountain
State New
Headers show
Series CIFS: Fix error code in smb311_posix_mkdir() | expand

Commit Message

Dan Carpenter June 21, 2018, 3:01 p.m. UTC
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@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Steve French June 21, 2018, 4:59 p.m. UTC | #1
merged the patches together

On Thu, Jun 21, 2018 at 10:01 AM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> 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@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 */
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

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 */