From: Pavel Shilovskiy <pshilov@microsoft.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
"sfrench@samba.org" <sfrench@samba.org>
Cc: "linux-cifs@vger.kernel.org" <linux-cifs@vger.kernel.org>,
"samba-technical@lists.samba.org"
<samba-technical@lists.samba.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: RE: [PATCH] CIFS: Fix some return values in case of error in 'crypt_message'
Date: Mon, 12 Jun 2017 23:12:17 +0000 [thread overview]
Message-ID: <CY4PR21MB0135BF129DED3C5BC7799C47B6CD0@CY4PR21MB0135.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20170611071247.2038-1-christophe.jaillet@wanadoo.fr>
2017-06-11 0:12 GMT-07:00 Christophe JAILLET <christophe.jaillet@wanadoo.fr>:
> 'rc' is known to be 0 at this point. So if 'init_sg' or 'kzalloc' fails, we
> should return -ENOMEM instead.
>
> Also remove a useless 'rc' in a debug message as it is meaningless here.
>
> Fixes: 026e93dc0a3ee ("CIFS: Encrypt SMB3 requests before sending")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> fs/cifs/smb2ops.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
> index c58691834eb2..cdcb3d95add8 100644
> --- a/fs/cifs/smb2ops.c
> +++ b/fs/cifs/smb2ops.c
> @@ -1809,7 +1809,8 @@ crypt_message(struct TCP_Server_Info *server, struct smb_rqst *rqst, int enc)
>
> sg = init_sg(rqst, sign);
> if (!sg) {
> - cifs_dbg(VFS, "%s: Failed to init sg %d", __func__, rc);
> + cifs_dbg(VFS, "%s: Failed to init sg", __func__);
> + rc = -ENOMEM;
> goto free_req;
> }
>
> @@ -1817,6 +1818,7 @@ crypt_message(struct TCP_Server_Info *server, struct smb_rqst *rqst, int enc)
> iv = kzalloc(iv_len, GFP_KERNEL);
> if (!iv) {
> cifs_dbg(VFS, "%s: Failed to alloc IV", __func__);
> + rc = -ENOMEM;
> goto free_sg;
> }
> iv[0] = 3;
> --
> 2.11.0
>
> --
> 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
Thanks for catching this.
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
--
Best regards,
Pavel Shilovsky
next prev parent reply other threads:[~2017-06-12 23:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-11 7:12 [PATCH] CIFS: Fix some return values in case of error in 'crypt_message' Christophe JAILLET
2017-06-12 15:56 ` Aurélien Aptel
2017-06-12 23:12 ` Pavel Shilovskiy [this message]
2017-06-21 17:01 ` Steve French
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=CY4PR21MB0135BF129DED3C5BC7799C47B6CD0@CY4PR21MB0135.namprd21.prod.outlook.com \
--to=pshilov@microsoft.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=samba-technical@lists.samba.org \
--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;
as well as URLs for NNTP newsgroup(s).