From: Jeff Layton <jlayton@kernel.org>
To: Gaosheng Cui <cuigaosheng1@huawei.com>,
trondmy@kernel.org, anna@kernel.org, chuck.lever@oracle.com,
neilb@suse.de, kolga@netapp.com, Dai.Ngo@oracle.com,
tom@talpey.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org
Cc: linux-nfs@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH -next,v2] gss_krb5: refactor code to return correct PTR_ERR in krb5_DK
Date: Fri, 12 Jul 2024 07:31:37 -0400 [thread overview]
Message-ID: <17aef036ab46b1d8e3f2dbf9433411390c4e7343.camel@kernel.org> (raw)
In-Reply-To: <20240712072423.1942417-1-cuigaosheng1@huawei.com>
On Fri, 2024-07-12 at 15:24 +0800, Gaosheng Cui wrote:
> Refactor the code in krb5_DK to return PTR_ERR when an error occurs.
>
> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
> ---
> v2: Update IS_ERR to PTR_ERR, thanks very much!
> net/sunrpc/auth_gss/gss_krb5_keys.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/net/sunrpc/auth_gss/gss_krb5_keys.c b/net/sunrpc/auth_gss/gss_krb5_keys.c
> index 4eb19c3a54c7..5ac8d06ab2c0 100644
> --- a/net/sunrpc/auth_gss/gss_krb5_keys.c
> +++ b/net/sunrpc/auth_gss/gss_krb5_keys.c
> @@ -164,10 +164,14 @@ static int krb5_DK(const struct gss_krb5_enctype *gk5e,
> goto err_return;
>
> cipher = crypto_alloc_sync_skcipher(gk5e->encrypt_name, 0, 0);
> - if (IS_ERR(cipher))
> + if (IS_ERR(cipher)) {
> + ret = PTR_ERR(cipher);
> goto err_return;
> + }
> +
> blocksize = crypto_sync_skcipher_blocksize(cipher);
> - if (crypto_sync_skcipher_setkey(cipher, inkey->data, inkey->len))
> + ret = crypto_sync_skcipher_setkey(cipher, inkey->data, inkey->len);
> + if (ret)
> goto err_free_cipher;
>
> ret = -ENOMEM;
Reviewed-by: Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2024-07-12 11:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-12 7:24 [PATCH -next,v2] gss_krb5: refactor code to return correct PTR_ERR in krb5_DK Gaosheng Cui
2024-07-12 8:37 ` Hariprasad Kelam
2024-07-12 11:31 ` Jeff Layton [this message]
2024-07-12 13:39 ` Chuck Lever
2024-07-12 14:28 ` Chuck Lever
2024-07-13 2:59 ` cuigaosheng
2024-07-14 4:31 ` NeilBrown
2024-07-14 16:18 ` Chuck Lever III
2024-07-15 1:44 ` cuigaosheng
2024-07-15 13:59 ` Chuck Lever
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=17aef036ab46b1d8e3f2dbf9433411390c4e7343.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=anna@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=cuigaosheng1@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kolga@netapp.com \
--cc=kuba@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tom@talpey.com \
--cc=trondmy@kernel.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