From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>,
linux-mmc <linux-mmc@vger.kernel.org>,
Chris Ball <chris@printf.net>,
Mark Rutland <mark.rutland@arm.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Hans de Goede <hdegoede@redhat.com>,
Russell King <linux@arm.linux.org.uk>,
Arnd Bergmann <arnd@arndb.de>,
Alexandre Courbot <gnurou@gmail.com>, NeilBrown <neilb@suse.de>,
Linus Walleij <linus.walleij@linaro.org>,
Doug Anderson <dianders@chromium.org>,
Olof Johansson <olof@lixom.net>, Mark Brown <broonie@kernel.org>,
Arend van Spriel <arend@broadcom.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH V3 4/4] mmc: pwrseq_simple: Add support for a reset GPIO pin
Date: Fri, 16 Jan 2015 13:45:11 +0100 [thread overview]
Message-ID: <20150116124511.GG18220@pengutronix.de> (raw)
In-Reply-To: <CAPDyKFoLqmgTvJpFLrGZvxrfug+SyspsYaOYtf65CsZ7T991pA@mail.gmail.com>
On Fri, Jan 16, 2015 at 01:37:41PM +0100, Ulf Hansson wrote:
> On 16 January 2015 at 12:34, Tomeu Vizoso <tomeu.vizoso@collabora.com> wrote:
> > On 16 January 2015 at 11:47, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >>
> >> int mmc_pwrseq_simple_alloc(struct mmc_host *host, struct device *dev)
> >> {
> >> struct mmc_pwrseq_simple *pwrseq;
> >> + int ret = 0;
> >>
> >> pwrseq = kzalloc(sizeof(struct mmc_pwrseq_simple), GFP_KERNEL);
> >> if (!pwrseq)
> >> return -ENOMEM;
> >>
> >> + pwrseq->reset_gpio = gpiod_get_index(dev, "reset", 0, GPIOD_OUT_HIGH);
> >> + if (IS_ERR(pwrseq->reset_gpio) &&
> >> + PTR_ERR(pwrseq->reset_gpio) != -ENOENT &&
> >> + PTR_ERR(pwrseq->reset_gpio) != -ENOSYS) {
> >> + ret = PTR_ERR(pwrseq->reset_gpio);
> >> + goto free;
> >> + }
> >> +
> >> pwrseq->pwrseq.ops = &mmc_pwrseq_simple_ops;
> >> host->pwrseq = &pwrseq->pwrseq;
> >>
> >> return 0;
> >> +free:
> >> + kfree(&pwrseq);
> >
> > Hi Ulf,
> >
> > this kfree looks a bit fishy (there's one more instance of it in
> > mmc_pwrseq_simple_free).
>
> This is the error path, which means I need to clean up data that I
> have allocated.
I think Tomeu meant that the '&' must be removed.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2015-01-16 12:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-16 10:47 [PATCH V3 0/4] mmc: core: Add support for MMC power sequences Ulf Hansson
2015-01-16 10:47 ` [PATCH V3 1/4] mmc: core: Initial " Ulf Hansson
2015-01-16 10:47 ` [PATCH V3 2/4] mmc: pwrseq: Document DT bindings for the simple MMC power sequence Ulf Hansson
[not found] ` <1421405273-19117-1-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-01-16 10:47 ` [PATCH V3 3/4] mmc: pwrseq: Initial support for the simple MMC power sequence provider Ulf Hansson
2015-01-16 10:47 ` [PATCH V3 4/4] mmc: pwrseq_simple: Add support for a reset GPIO pin Ulf Hansson
[not found] ` <1421405273-19117-5-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-01-16 11:34 ` Tomeu Vizoso
2015-01-16 12:37 ` Ulf Hansson
2015-01-16 12:45 ` Sascha Hauer [this message]
2015-01-16 12:52 ` Ulf Hansson
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=20150116124511.GG18220@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=arend@broadcom.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=chris@printf.net \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=gnurou@gmail.com \
--cc=hdegoede@redhat.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=neilb@suse.de \
--cc=olof@lixom.net \
--cc=tomeu.vizoso@collabora.com \
--cc=ulf.hansson@linaro.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 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).