From: Dan Carpenter <dan.carpenter@oracle.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
"Ivan T. Ivanov" <iivanov@mm-sol.com>
Cc: Felipe Balbi <balbi@ti.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] usb: phy: msm: devm_ioremap() doesn't return ERR_PTRs
Date: Wed, 14 May 2014 16:44:09 +0300 [thread overview]
Message-ID: <20140514134409.GE16836@mwanda> (raw)
In-Reply-To: <53736EA4.8040203@cogentembedded.com>
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@oracle.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
prev parent reply other threads:[~2014-05-14 13:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1400050877.8431.9.camel@iivanov-dev>
2014-05-14 12:55 ` [patch] usb: phy: msm: devm_ioremap() doesn't return ERR_PTRs Dan Carpenter
2014-05-14 13:18 ` Fabio Estevam
2014-05-14 13:24 ` Sergei Shtylyov
2014-05-14 13:44 ` Dan Carpenter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140514134409.GE16836@mwanda \
--to=dan.carpenter@oracle.com \
--cc=balbi@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=iivanov@mm-sol.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=sergei.shtylyov@cogentembedded.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).