Re: [PATCH] crypto: keembay: Fix AEAD unregister count in error path

From: Herbert Xu

Date: Sun Jul 05 2026 - 04:41:48 EST


On Wed, Jun 24, 2026 at 04:15:49PM +0900, Myeonghun Pak wrote:
> register_aes_algs() registers the AEAD algorithms before registering the
> skcipher algorithms. If skcipher registration fails, the function unwinds
> the earlier AEAD registration with crypto_engine_unregister_aeads(), but it
> passes ARRAY_SIZE(algs), which is the skcipher table size.
>
> Use ARRAY_SIZE(algs_aead) for the AEAD unwind path so the unregister helper
> iterates over the same table that was registered. Also clarify the nearby
> comment: the crypto registration helpers clean up algorithms registered
> within the same call, while this function must still unwind earlier
> successful registration steps.
>
> Fixes: 885743324513 ("crypto: keembay - Add support for Keem Bay OCS AES/SM4")
> Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>
>
> ---
> drivers/crypto/intel/keembay/keembay-ocs-aes-core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

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