From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Dan Carpenter <dan.carpenter@oracle.com>, Felipe Balbi <balbi@ti.com>
Cc: 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 13:24:52 +0000 [thread overview]
Message-ID: <53736EA4.8040203@cogentembedded.com> (raw)
In-Reply-To: <20140514125524.GB14571@mwanda>
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?
> motg->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> - if (IS_ERR(motg->regs))
> - return PTR_ERR(motg->regs);
> + if (!motg->regs)
> + return -ENOMEM;
>
> /*
> * NOTE: The PHYs can be multiplexed between the chipidea controller
WBR, Sergei
WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Dan Carpenter <dan.carpenter@oracle.com>, Felipe Balbi <balbi@ti.com>
Cc: 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 17:24:52 +0400 [thread overview]
Message-ID: <53736EA4.8040203@cogentembedded.com> (raw)
In-Reply-To: <20140514125524.GB14571@mwanda>
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?
> motg->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> - if (IS_ERR(motg->regs))
> - return PTR_ERR(motg->regs);
> + if (!motg->regs)
> + return -ENOMEM;
>
> /*
> * NOTE: The PHYs can be multiplexed between the chipidea controller
WBR, Sergei
next prev parent reply other threads:[~2014-05-14 13:24 UTC|newest]
Thread overview: 8+ 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 12:55 ` Dan Carpenter
2014-05-14 13:18 ` Fabio Estevam
2014-05-14 13:18 ` Fabio Estevam
2014-05-14 13:24 ` Sergei Shtylyov [this message]
2014-05-14 13:24 ` Sergei Shtylyov
2014-05-14 13:44 ` Dan Carpenter
2014-05-14 13:44 ` Dan Carpenter
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=53736EA4.8040203@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=balbi@ti.com \
--cc=dan.carpenter@oracle.com \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh+dt@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.