Re: [PATCH] crypto: chcr - Free fallback transforms when device assignment fails

From: Herbert Xu

Date: Fri Nov 13 2026 - 11:33:10 EST


On Tue, Nov 03, 2026 at 06:38:50AM +0000, Wentao Liang wrote:
> The skcipher, RFC3686 and AEAD initialization callbacks allocate their
> fallback transforms before calling chcr_device_init(). If no active
> device can be assigned, chcr_device_init() returns -ENXIO and the
> fallback is leaked. The crypto core does not invoke the algorithm's
> exit callback after its initialization callback fails.
>
> Free the fallback transform before returning the device assignment
> error in each of these initialization callbacks.
>
> Fixes: b8fd1f4170e7 ("crypto: chcr - Add ctr mode and process large sg entries for cipher")
> Fixes: 0e93708dabc0 ("crypto: chcr - Add fallback for AEAD algos")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
> ---
> drivers/crypto/chelsio/chcr_algo.c | 21 ++++++++++++++++++---
> 1 file changed, 18 insertions(+), 3 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