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: <1553398466.26628.0.camel@mtksdaap41>
Date:   Sun, 24 Mar 2019 11:34:26 +0800
From:   Yingjoe Chen <yingjoe.chen@...iatek.com>
To:     Fabien Parent <fparent@...libre.com>
CC:     <matthias.bgg@...il.com>, <robh+dt@...nel.org>,
        <mark.rutland@....com>, <linux-arm-kernel@...ts.infradead.org>,
        <devicetree@...r.kernel.org>, <ryder.lee@...iatek.com>,
        <linux-watchdog@...r.kernel.org>, <jjian.zhou@...iatek.com>,
        <wenzhen.yu@...iatek.com>, <stephane.leprovost@...iatek.com>,
        <sean.wang@...nel.org>, <linux-mmc@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <yong.mao@...iatek.com>,
        <linux-spi@...r.kernel.org>, <linux-gpio@...r.kernel.org>,
        <linux-mediatek@...ts.infradead.org>,
        <hsin-hsiung.wang@...iatek.com>, <linux-serial@...r.kernel.org>,
        <linux-clk@...r.kernel.org>, <chaotian.jing@...iatek.com>,
        <linux-i2c@...r.kernel.org>
Subject: Re: [PATCH 09/24] mmc: mtk-sd: check for valid optional memory
 resource

On Sat, 2019-03-23 at 22:15 +0100, Fabien Parent wrote:
> 'top_base' memory region is optional. Check that the resource is valid
> before using it. This avoid getting a "invalid resource" error message
> printed by the kernel.
> 
> Signed-off-by: Fabien Parent <fparent@...libre.com>
> ---
>  drivers/mmc/host/mtk-sd.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index 833ef0590af8..573aa127d00b 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -2123,9 +2123,11 @@ static int msdc_drv_probe(struct platform_device *pdev)
>  	}
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> -	host->top_base = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(host->top_base))
> -		host->top_base = NULL;
> +	if (ret) {

This should be res?

> +		host->top_base = devm_ioremap_resource(&pdev->dev, res);
> +		if (IS_ERR(host->top_base))
> +			host->top_base = NULL;
> +	}
>  
>  	ret = mmc_regulator_get_supply(mmc);
>  	if (ret)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ