diff mbox series

cifsd: Fix an error code in smb2_read()

Message ID YFiuo53u7GHg7cU5@mwanda (mailing list archive)
State New, archived
Headers show
Series cifsd: Fix an error code in smb2_read() | expand

Commit Message

Dan Carpenter March 22, 2021, 2:50 p.m. UTC
This code is assigning the wrong variable to "err" so it returns
zero/success instead of -ENOMEM.

Fixes: 788b6f45c1d2 ("cifsd: add server-side procedures for SMB3")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/cifsd/smb2pdu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Namjae Jeon March 23, 2021, 5:35 a.m. UTC | #1
Hi Dan,
> This code is assigning the wrong variable to "err" so it returns zero/success instead of -ENOMEM.
> 
> Fixes: 788b6f45c1d2 ("cifsd: add server-side procedures for SMB3")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
I will apply this patch.
Thanks for your work!
> ---
>  fs/cifsd/smb2pdu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/cifsd/smb2pdu.c b/fs/cifsd/smb2pdu.c index 32816baa8a99..6770ebedc24a 100644
> --- a/fs/cifsd/smb2pdu.c
> +++ b/fs/cifsd/smb2pdu.c
> @@ -6200,7 +6200,7 @@ int smb2_read(struct ksmbd_work *work)
>  		work->aux_payload_buf = ksmbd_alloc_response(length);
>  	}
>  	if (!work->aux_payload_buf) {
> -		err = nbytes;
> +		err = -ENOMEM;
>  		goto out;
>  	}
> 
> --
> 2.30.2
diff mbox series

Patch

diff --git a/fs/cifsd/smb2pdu.c b/fs/cifsd/smb2pdu.c
index 32816baa8a99..6770ebedc24a 100644
--- a/fs/cifsd/smb2pdu.c
+++ b/fs/cifsd/smb2pdu.c
@@ -6200,7 +6200,7 @@  int smb2_read(struct ksmbd_work *work)
 		work->aux_payload_buf = ksmbd_alloc_response(length);
 	}
 	if (!work->aux_payload_buf) {
-		err = nbytes;
+		err = -ENOMEM;
 		goto out;
 	}