]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: tegra - Fix dma_free_coherent size error
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 19 May 2026 04:22:18 +0000 (12:22 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 29 May 2026 05:54:43 +0000 (13:54 +0800)
commit03215b8457784540acc741e6331e355b62c6c8ab
treecee9122fb919d7326c23f60422f59bd4f4f63b9b
parent85a61bf9145d4097c740ffcf3aa832d930a8913b
crypto: tegra - Fix dma_free_coherent size error

When freeing a coherent DMA buffer, the size must match the value
that was used during the allocation.

Unfortunately the size field in the tegra driver gets overwritten
by this point so it no longer matches and creates a warning.

Fix this by saving a copy of the size on the stack.

Note that the ccm function actually mixes up the inbuf and outbuf
sizes, but it doesn't matter because the two sizes are actually
equal.

Fixes: 1cb328da4e8f ("crypto: tegra - Do not use fixed size buffers")
Reporeted-by: Patrick Talbert <ptalbert@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Vladislav Dronov <vdronov@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/tegra/tegra-se-aes.c