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] [thread-next>] [day] [month] [year] [list]
Message-ID: <01883a69834142f14cd3ac6c9cb97343ee432d67.camel@nxp.com>
Date:   Mon, 26 Aug 2019 12:01:07 +0000
From:   Daniel Baluta <daniel.baluta@....com>
To:     "weiyongjun1@...wei.com" <weiyongjun1@...wei.com>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "tiwai@...e.com" <tiwai@...e.com>,
        "lgirdwood@...il.com" <lgirdwood@...il.com>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "perex@...ex.cz" <perex@...ex.cz>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>
CC:     "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH -next] ASoC: SOF: imx8: Fix return value check in
 imx8_probe()

On Mon, 2019-08-26 at 12:00 +0000, Wei Yongjun wrote:
> In case of error, the function devm_ioremap_wc() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
> 
> Fixes: 202acc565a1f ("ASoC: SOF: imx: Add i.MX8 HW support")
> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>

Good catch. Thanks!

Reviewed-by: Daniel Baluta <daniel.baluta@....com>

> ---
>  sound/soc/sof/imx/imx8.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c
> index e502f584207f..263d4df35fe8 100644
> --- a/sound/soc/sof/imx/imx8.c
> +++ b/sound/soc/sof/imx/imx8.c
> @@ -296,10 +296,10 @@ static int imx8_probe(struct snd_sof_dev *sdev)
>  	sdev->bar[SOF_FW_BLK_TYPE_SRAM] = devm_ioremap_wc(sdev->dev,
> res.start,
>  							  res.end -
> res.start +
>  							  1);
> -	if (IS_ERR(sdev->bar[SOF_FW_BLK_TYPE_SRAM])) {
> +	if (!sdev->bar[SOF_FW_BLK_TYPE_SRAM]) {
>  		dev_err(sdev->dev, "failed to ioremap mem 0x%x size
> 0x%x\n",
>  			base, size);
> -		ret = PTR_ERR(sdev->bar[SOF_FW_BLK_TYPE_SRAM]);
> +		ret = -ENOMEM;
>  		goto exit_pdev_unregister;
>  	}
>  	sdev->mailbox_bar = SOF_FW_BLK_TYPE_SRAM;
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ