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: <20140514134409.GE16836@mwanda>
Date:	Wed, 14 May 2014 16:44:09 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
	"Ivan T. Ivanov" <iivanov@...sol.com>
Cc:	Felipe Balbi <balbi@...com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Grant Likely <grant.likely@...aro.org>,
	Rob Herring <robh+dt@...nel.org>, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: Re: [patch] usb: phy: msm: devm_ioremap() doesn't return ERR_PTRs

On Wed, May 14, 2014 at 05:24:52PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 14-05-2014 16:55, Dan Carpenter wrote:
> 
> >devm_ioremap() returns a NULL on error so the IS_ERR() check needs to be
> >updated.
> 
> >Fixes: 6b99c68ec1f9 ('usb: phy: msm: Migrate to Managed Device Resource allocation')
> >Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> 
> >diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> >index c522c4f..bd32257 100644
> >--- a/drivers/usb/phy/phy-msm-usb.c
> >+++ b/drivers/usb/phy/phy-msm-usb.c
> >@@ -1587,8 +1587,8 @@ static int msm_otg_probe(struct platform_device *pdev)
> >
> >  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> 
>    Hm, 'res' can be NULL too, why this isn't checked?

Yeah.  You're right.  The correct idiom is to use devm_ioremap_resource()
like Fabio says, since it has checking built in.  Also the original code
was missing a call to a request_mem_region function here but so that's
buggy.

Ivan, I am so cross with you right now...   *Grumble*.

v2 coming up.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ