Re: [PATCH] crypto: chelsio: fix inflight counter leak in chcr_aes_encrypt()
From: Herbert Xu
Date: Fri Jun 05 2026 - 06:44:33 EST
On Tue, May 26, 2026 at 03:57:36PM +0000, Wentao Liang wrote:
> chcr_aes_encrypt() increments dev->inflight via atomic_inc() before
> submitting the cipher operation. If chcr_start_cipher() subsequently
> fails, the function returns an error without decrementing dev->inflight,
> causing the counter to drift and potentially stalling future operations
> that rely on the counter reaching zero.
>
> Add atomic_dec(&dev->inflight) on the chcr_start_cipher() failure path
> to restore the counter.
>
> Fixes: b8fd1f4170e7 ("crypto: chcr - Add ctr mode and process large sg entries for cipher")
I think it should be
fef4912b66d6 ("crypto: chelsio - Handle PCI shutdown event")
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt