Re: [PATCH] crypto: chelsio: fix inflight counter leak in chcr_aead_op()

From: Herbert Xu

Date: Fri Jun 05 2026 - 06:41:31 EST


On Tue, May 26, 2026 at 04:06:55PM +0000, Wentao Liang wrote:
> chcr_aead_op() increments cdev->inflight via atomic_inc() before
> submitting the AEAD operation. If the operation fails after the
> increment (e.g., chcr_start_aead() returns an error), the function
> returns without decrementing cdev->inflight. This leaks a reference
> on the inflight counter, preventing proper teardown sequencing.
>
> Add atomic_dec(&cdev->inflight) on the error path to balance the
> counter.
>
> Fixes: d91a3159e8d9 ("Crypto/chcr: fix gcm-aes and rfc4106-gcm failed tests")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
> ---
> drivers/crypto/chelsio/chcr_algo.c | 1 +
> 1 file changed, 1 insertion(+)

Please merge these patches into one. There is no need to send
one patch per function.

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