[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZXKW/lVRTeAAPe31@gondor.apana.org.au>
Date: Fri, 8 Dec 2023 12:09:34 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Nikita Zhandarovich <n.zhandarovich@...tech.ru>
Cc: atenart@...nel.org, n.zhandarovich@...tech.ru, davem@...emloft.net,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] crypto: safexcel - Add error handling for
dma_map_sg() calls
Nikita Zhandarovich <n.zhandarovich@...tech.ru> wrote:
> Macro dma_map_sg() may return 0 on error. This patch enables
> checks in case of the macro failure and ensures unmapping of
> previously mapped buffers with dma_unmap_sg().
>
> Found by Linux Verification Center (linuxtesting.org) with static
> analysis tool SVACE.
>
> Fixes: 49186a7d9e46 ("crypto: inside_secure - Avoid dma map if size is zero")
> Signed-off-by: Nikita Zhandarovich <n.zhandarovich@...tech.ru>
> ---
> v2: remove extra level of parentheses and
> change return error code from -ENOMEM to EIO
> per Antoine Tenart's <atenart@...nel.org> suggestion
>
> drivers/crypto/inside-secure/safexcel_cipher.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists