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]
Message-ID: <20170814173002.GB15368@dtor-ws>
Date:   Mon, 14 Aug 2017 10:30:02 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Pan Bian <bianpan2016@....com>
Cc:     Lee Jones <lee.jones@...aro.org>,
        Ksenija Stanojevic <ksenija.stanojevic@...il.com>,
        Marek Vasut <marex@...x.de>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: input: touchscreen: mxs-lradc: use correct error check

On Tue, Aug 08, 2017 at 09:00:37PM +0800, Pan Bian wrote:
> Function devm_ioremap() will return a NULL pointer on failure. However,
> in function mxs_lradc_ts_probe(), its return value is checked with
> IS_ERR(), which cannot detect the exceptional case.
> 
> Signed-off-by: Pan Bian <bianpan2016@....com>

Applied, thank you.

> ---
>  drivers/input/touchscreen/mxs-lradc-ts.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
> index 58c016c..9bcc98c6 100644
> --- a/drivers/input/touchscreen/mxs-lradc-ts.c
> +++ b/drivers/input/touchscreen/mxs-lradc-ts.c
> @@ -631,8 +631,8 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
>  
>  	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
> -	if (IS_ERR(ts->base))
> -		return PTR_ERR(ts->base);
> +	if (!ts->base)
> +		return -ENOMEM;
>  
>  	ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
>  				   &ts_wires);
> -- 
> 1.9.1
> 
> 

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ