Re: [PATCH] crypto: sa2ul: add missing IS_ERR checks
From: Herbert Xu
Date: Fri Feb 27 2026 - 22:40:52 EST
On Mon, Feb 16, 2026 at 05:16:09PM -0600, Ethan Tidmore wrote:
> The function dmaengine_desc_get_metadata_ptr() can return an error
> pointer and is not checked for it. Add error pointer checks.
>
> Fixes: 7694b6ca649fe ("crypto: sa2ul - Add crypto driver")
> Signed-off-by: Ethan Tidmore <ethantidmore06@xxxxxxxxx>
> ---
> drivers/crypto/sa2ul.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
> index fdc0b2486069..58d41c269d62 100644
> --- a/drivers/crypto/sa2ul.c
> +++ b/drivers/crypto/sa2ul.c
> @@ -1051,6 +1051,9 @@ static void sa_aes_dma_in_callback(void *data)
> if (req->iv) {
> mdptr = (__be32 *)dmaengine_desc_get_metadata_ptr(rxd->tx_in, &pl,
> &ml);
> + if (IS_ERR(mdptr))
> + return;
Thanks for adding the error checks. However, if we get an error
here shouldn't we still free the resources and pass the error up
to the caller?
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt