Re: [PATCH] crypto: chelsio - Fix potential NULL dereference after detach

From: Herbert Xu

Date: Fri Nov 27 2026 - 00:11:33 EST


Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx> wrote:
> Detached contexts remain on the inactive list until module exit, but
> their PCI driver data has already been cleared. Looking up the adapter
> to reset its counters then dereferences NULL.
>
> Skip the adapter lookup for detached contexts and free the contexts
> without accessing the removed adapter.
>
> This issue was found by our static analysis tool under development.
>
> Fixes: c0271a053612 ("crypto: chelsio - Resetting crypto counters during the driver unregister")
> Signed-off-by: Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx>
> ---
> drivers/crypto/chelsio/chcr_core.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