public inbox for linux-cifs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Namjae Jeon <namjae.jeon@samsung.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Steve French <sfrench@samba.org>,
	Hyunchul Lee <hyc.lee@gmail.com>,
	Ronnie Sahlberg <lsahlber@redhat.com>,
	linux-cifs@vger.kernel.org,
	linux-cifsd-devel@lists.sourceforge.net,
	kernel-janitors@vger.kernel.org
Subject: [PATCH] cifsd: Fix an error code in smb2_read()
Date: Mon, 22 Mar 2021 17:50:11 +0300	[thread overview]
Message-ID: <YFiuo53u7GHg7cU5@mwanda> (raw)

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(-)

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


             reply	other threads:[~2021-03-22 14:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210322145056epcas1p2803a480b8b83f038407553c2b25fd384@epcas1p2.samsung.com>
2021-03-22 14:50 ` Dan Carpenter [this message]
2021-03-23  5:35   ` [PATCH] cifsd: Fix an error code in smb2_read() Namjae Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YFiuo53u7GHg7cU5@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=hyc.lee@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-cifsd-devel@lists.sourceforge.net \
    --cc=lsahlber@redhat.com \
    --cc=namjae.jeon@samsung.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=sfrench@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox