* [PATCH -next] gss_krb5: refactor code to return correct PTR_ERR in krb5_DK
@ 2024-07-12 6:03 Gaosheng Cui
2024-07-12 7:09 ` Hariprasad Kelam
0 siblings, 1 reply; 3+ messages in thread
From: Gaosheng Cui @ 2024-07-12 6:03 UTC (permalink / raw)
To: trondmy, anna, chuck.lever, jlayton, neilb, kolga, Dai.Ngo, tom,
davem, edumazet, kuba, pabeni, horms, cuigaosheng1
Cc: linux-nfs, netdev
Refactor the code in krb5_DK to return PTR_ERR when an error occurs.
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
---
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..b809e646329f 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 = IS_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;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] gss_krb5: refactor code to return correct PTR_ERR in krb5_DK
2024-07-12 6:03 [PATCH -next] gss_krb5: refactor code to return correct PTR_ERR in krb5_DK Gaosheng Cui
@ 2024-07-12 7:09 ` Hariprasad Kelam
2024-07-12 7:25 ` cuigaosheng
0 siblings, 1 reply; 3+ messages in thread
From: Hariprasad Kelam @ 2024-07-12 7:09 UTC (permalink / raw)
To: Gaosheng Cui
Cc: trondmy, anna, chuck.lever, jlayton, neilb, kolga, Dai.Ngo, tom,
davem, edumazet, kuba, pabeni, horms, linux-nfs, netdev
On 2024-07-12 at 11:33:12, Gaosheng Cui (cuigaosheng1@huawei.com) wrote:
> Refactor the code in krb5_DK to return PTR_ERR when an error occurs.
>
> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
> ---
> 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..b809e646329f 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 = IS_ERR(cipher);
need to use PTR_ERR?
Thanks,
Hariprasad k
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] gss_krb5: refactor code to return correct PTR_ERR in krb5_DK
2024-07-12 7:09 ` Hariprasad Kelam
@ 2024-07-12 7:25 ` cuigaosheng
0 siblings, 0 replies; 3+ messages in thread
From: cuigaosheng @ 2024-07-12 7:25 UTC (permalink / raw)
To: Hariprasad Kelam
Cc: trondmy, anna, chuck.lever, jlayton, neilb, kolga, Dai.Ngo, tom,
davem, edumazet, kuba, pabeni, horms, linux-nfs, netdev
yeah, thanks very much.
On 2024/7/12 15:09, Hariprasad Kelam wrote:
> On 2024-07-12 at 11:33:12, Gaosheng Cui (cuigaosheng1@huawei.com) wrote:
>> Refactor the code in krb5_DK to return PTR_ERR when an error occurs.
>>
>> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
>> ---
>> 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..b809e646329f 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 = IS_ERR(cipher);
> need to use PTR_ERR?
>
> Thanks,
> Hariprasad k
>
>
> .
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-12 7:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12 6:03 [PATCH -next] gss_krb5: refactor code to return correct PTR_ERR in krb5_DK Gaosheng Cui
2024-07-12 7:09 ` Hariprasad Kelam
2024-07-12 7:25 ` cuigaosheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox