From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Michal Bachraty <michal.bachraty@streamunlimited.com>
Cc: grant.likely@secretlab.ca, rob.herring@calxeda.com,
rob@landley.net, devicetree-discuss@lists.ozlabs.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org
Subject: Re: [PATCH] cpsw: Add support to read cpu MAC address
Date: Fri, 11 Jan 2013 15:47:53 +0000 [thread overview]
Message-ID: <20130111154753.GB23505@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1357917302-32550-1-git-send-email-michal.bachraty@streamunlimited.com>
On Fri, Jan 11, 2013 at 04:15:02PM +0100, Michal Bachraty wrote:
> + if (!request_mem_region(priv->conf_res->start,
> + resource_size(priv->conf_res), ndev->name)) {
> + dev_err(priv->dev, "failed request i/o region\n");
> + ret = -ENXIO;
> + goto clean_clk_ret;
> + }
> +
> + regs = ioremap(priv->conf_res->start,
> + resource_size(priv->conf_res));
> + if (!regs) {
> + dev_err(priv->dev, "unable to map i/o region\n");
> + goto clean_configuration_iores_ret;
> + }
In this day and age where error paths don't get any testing, and are
frequently buggy, where we have alternative APIs which make those paths
more reliable, I think we should do everything to make use of that.
And, to prove the point, your error paths are buggy. Yes, you release
the mem region correctly (well done for picking the right interface for
that!) but the ioremap() is never cleaned up.
So, any chance of converting the above to devm_request_and_ioremap() ?
Thanks.
next prev parent reply other threads:[~2013-01-11 15:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 15:15 [PATCH] cpsw: Add support to read cpu MAC address Michal Bachraty
2013-01-11 15:47 ` Russell King - ARM Linux [this message]
2013-01-14 20:26 ` Grant Likely
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=20130111154753.GB23505@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.bachraty@streamunlimited.com \
--cc=netdev@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
/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).