Re: [PATCH] crypto: sa2ul: add missing IS_ERR checks
From: Ethan Tidmore
Date: Sun Mar 01 2026 - 17:54:24 EST
On Fri Feb 27, 2026 at 9:40 PM CST, Herbert Xu wrote:
> 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,
Since this is a callback I'm not sure how to propagate the error. Nor am
I aware of the specific teardown required for this driver. I'll just
drop this patch for now, hopefully I was able to draw your attention to
this possible issue
Thanks,
ET