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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 4 Aug 2023 17:08:15 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     Wang Ming <machel@...o.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
        opensource.kernel@...o.com
Subject: Re: [PATCH v2] crypto: Use dev_err_probe instead of dev_err

On Wed, Jul 26, 2023 at 08:03:04PM +0800, Wang Ming wrote:
> It is possible that dma_request_chan will return EPROBE_DEFER,
> which means that dd->dev is not ready yet. In this case,
> dev_err(dd->dev), there will be no output. This patch fixes the bug.
> 
> Signed-off-by: Wang Ming <machel@...o.com>
> ---
>  drivers/crypto/omap-aes.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
> index 67a99c760bc4..de7f1eeb675a 100644
> --- a/drivers/crypto/omap-aes.c
> +++ b/drivers/crypto/omap-aes.c
> @@ -236,14 +236,14 @@ static int omap_aes_dma_init(struct omap_aes_dev *dd)
>  
>  	dd->dma_lch_in = dma_request_chan(dd->dev, "rx");
>  	if (IS_ERR(dd->dma_lch_in)) {
> -		dev_err(dd->dev, "Unable to request in DMA channel\n");
> -		return PTR_ERR(dd->dma_lch_in);
> +		return dev_err_probe(dd->dev, PTR_ERR(dd->dma_lch_in),
> +			Unable to request in DMA channel\n");
>  	}
>  
>  	dd->dma_lch_out = dma_request_chan(dd->dev, "tx");
>  	if (IS_ERR(dd->dma_lch_out)) {
> -		dev_err(dd->dev, "Unable to request out DMA channel\n");
> -		err = PTR_ERR(dd->dma_lch_out);
> +		err = dev_err_probe(dd->dev, PTR_ERR(dd->dma_lch_out),
> +			"Unable to request out DMA channel\n");
>  		goto err_dma_out;
>  	}

This doesn't even compile.
-- 
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ