mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Chen Ni <nichen@iscas.ac.cn>
Cc: davem@davemloft.net, t-kristo@ti.com, j-keerthy@ti.com,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	nichen@iscas.ac.cn
Subject: Re: [PATCH] crypto: sa2ul - Add check for crypto_aead_setkey
Date: Fri, 17 Nov 2023 18:29:00 +0800	[thread overview]
Message-ID: <ZVdAbHSItfzhl++h@gondor.apana.org.au> (raw)
In-Reply-To: <20231107063152.529830-1-nichen@iscas.ac.cn>

Chen Ni <nichen@iscas.ac.cn> wrote:
> Add check for crypto_aead_setkey() and return the error if it fails
> in order to transfer the error.
> 
> Fixes: d2c8ac187fc9 ("crypto: sa2ul - Add AEAD algorithm support")
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
> ---
> drivers/crypto/sa2ul.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
> index 6846a8429574..6bac2382e261 100644
> --- a/drivers/crypto/sa2ul.c
> +++ b/drivers/crypto/sa2ul.c
> @@ -1806,6 +1806,7 @@ static int sa_aead_setkey(struct crypto_aead *authenc,
>        int cmdl_len;
>        struct sa_cmdl_cfg cfg;
>        int key_idx;
> +       int error;
> 
>        if (crypto_authenc_extractkeys(&keys, key, keylen) != 0)
>                return -EINVAL;
> @@ -1869,7 +1870,9 @@ static int sa_aead_setkey(struct crypto_aead *authenc,
>        crypto_aead_set_flags(ctx->fallback.aead,
>                              crypto_aead_get_flags(authenc) &
>                              CRYPTO_TFM_REQ_MASK);
> -       crypto_aead_setkey(ctx->fallback.aead, key, keylen);
> +       error = crypto_aead_setkey(ctx->fallback.aead, key, keylen);
> +       if (error)
> +               return error;

This should be

	return crypto_aead_setkey(ctx->fallback.aead, key, keylen);

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      reply	other threads:[~2023-11-17 10:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07  6:31 Chen Ni
2023-11-17 10:29 ` Herbert Xu [this message]

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=ZVdAbHSItfzhl++h@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=j-keerthy@ti.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nichen@iscas.ac.cn \
    --cc=t-kristo@ti.com \
    /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

all inboxes | Powered by JetHome®