From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public•gmane.org>
To: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public•gmane.org>
Cc: Paul Walmsley <paul-DWxLp4Yu+b8AvxtiuMwx3w@public•gmane.org>,
gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public•gmane.org,
hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public•gmane.org,
pwalmsley-DDmLM1+adcrQT0dZR+AlfA@public•gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public•gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
linux-next-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
linux-ide-u79uwXL29TY76Z2rM5mHXA@public•gmane.org
Subject: Re: next-20150120 broken on Tegra by "ata: libahci: Allow using multiple regulators"
Date: Wed, 21 Jan 2015 11:25:23 -0500 [thread overview]
Message-ID: <20150121162523.GE8684@htj.dyndns.org> (raw)
In-Reply-To: <20150121155519.GA25166-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
On Wed, Jan 21, 2015 at 04:55:21PM +0100, Thierry Reding wrote:
> From a4f78e3ec05f1b2ad86aa44d6bd5394d75a23a06 Mon Sep 17 00:00:00 2001
> From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public•gmane.org>
> Date: Wed, 21 Jan 2015 11:50:52 +0100
> Subject: [PATCH] ata: libahci: Fix devres cleanup on failure
>
> Commit c7d7ddee7e24 ("ata: libahci: Allow using multiple regulators")
> releases regulators during ahci_platform_put_resources(). That doesn't
> work because the function is run as part of the devres machinery. Such
> resources are torn down in reverse order. Since the array that holds
> pointers to the regulators is allocated using devres after the device
> context to which ahci_platform_put_resources() is attached, the memory
> will be freed before calling ahci_platform_put_resources() and thereby
> causing a use-after-free error.
>
> This commit fixes this by using regular allocations for the array. The
> memory can then be freed after the regulators have been released. This
> conserves the advantages of using the managed API.
>
> Reported-by: Paul Walmsley <paul-DWxLp4Yu+b8AvxtiuMwx3w@public•gmane.org>
> Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public•gmane.org>
Applied to libata/for-3.20.
Thanks.
--
tejun
next prev parent reply other threads:[~2015-01-21 16:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-21 0:03 next-20150120 broken on Tegra by "ata: libahci: Allow using multiple regulators" Paul Walmsley
2015-01-21 10:50 ` Thierry Reding
2015-01-21 11:23 ` Gregory CLEMENT
[not found] ` <20150121105001.GA9921-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2015-01-21 12:31 ` Tejun Heo
2015-01-21 15:55 ` Thierry Reding
[not found] ` <20150121155519.GA25166-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2015-01-21 16:25 ` Tejun Heo [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-01-21 0:00 Paul Walmsley
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=20150121162523.GE8684@htj.dyndns.org \
--to=tj-dgejt+ai2ygdnm+yrofe0a@public$(echo .)gmane.org \
--cc=gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public$(echo .)gmane.org \
--cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public$(echo .)gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public$(echo .)gmane.org \
--cc=linux-ide-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
--cc=linux-next-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
--cc=paul-DWxLp4Yu+b8AvxtiuMwx3w@public$(echo .)gmane.org \
--cc=pwalmsley-DDmLM1+adcrQT0dZR+AlfA@public$(echo .)gmane.org \
--cc=treding-DDmLM1+adcrQT0dZR+AlfA@public$(echo .)gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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