Re: [PATCH] crypto: atmel-aes - guard unregister on error in atmel_aes_register_algs

From: Herbert Xu

Date: Sat Mar 21 2026 - 04:49:39 EST


On Wed, Mar 11, 2026 at 12:39:28PM +0100, Thorsten Blum wrote:
> Ensure the device supports XTS and GCM with 'has_xts' and 'has_gcm'
> before unregistering algorithms when XTS or authenc registration fails,
> which would trigger a WARN in crypto_unregister_alg().
>
> Currently, with the capabilities defined in atmel_aes_get_cap(), this
> bug cannot happen because all devices that support XTS and authenc also
> support GCM, but the error handling should still be correct regardless
> of hardware capabilities.
>
> Fixes: d52db5188a87 ("crypto: atmel-aes - add support to the XTS mode")
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> ---
> drivers/crypto/atmel-aes.c | 6 ++++--
> 1 file changed, 4 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