lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOtvUMdRvb_sQHW21MDXj3faUjOTTzCcwFDvnuCq7W_j0hyskg@mail.gmail.com>
Date:   Sun, 21 Aug 2022 12:44:04 +0300
From:   Gilad Ben-Yossef <gilad@...yossef.com>
To:     Jack Wang <jinpu.wang@...os.com>
Cc:     Linux kernel mailing list <linux-kernel@...r.kernel.org>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        Linux Crypto Mailing List <linux-crypto@...r.kernel.org>
Subject: Re: [PATCH v1 12/19] crypto: ccree: Fix dma_map_sg error check

Hi Jack,

On Fri, Aug 19, 2022 at 9:08 AM Jack Wang <jinpu.wang@...os.com> wrote:
>
> dma_map_sg return 0 on error, and dma_map_error is not supposed to use
> here.
>
> Cc: Gilad Ben-Yossef <gilad@...yossef.com>
> Cc: Herbert Xu <herbert@...dor.apana.org.au>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: linux-crypto@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org
>
> Signed-off-by: Jack Wang <jinpu.wang@...os.com>
> ---
>  drivers/crypto/ccree/cc_buffer_mgr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/ccree/cc_buffer_mgr.c b/drivers/crypto/ccree/cc_buffer_mgr.c
> index 6140e4927322..9efd88f871d1 100644
> --- a/drivers/crypto/ccree/cc_buffer_mgr.c
> +++ b/drivers/crypto/ccree/cc_buffer_mgr.c
> @@ -274,7 +274,7 @@ static int cc_map_sg(struct device *dev, struct scatterlist *sg,
>         }
>
>         ret = dma_map_sg(dev, sg, *nents, direction);
> -       if (dma_mapping_error(dev, ret)) {
> +       if (!ret) {
>                 *nents = 0;
>                 dev_err(dev, "dma_map_sg() sg buffer failed %d\n", ret);
>                 return -ENOMEM;
> --
> 2.34.1
>

Good catch!

Thank you for the patch.

Signed-off-by: Gilad Ben-Yossef <gilad@...yossef.com>

Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker

values of β will give rise to dom!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ