From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
jiang.liu@linux.intel.com
Subject: Re: [PATCH] drivers: of: pci: remove duplicate kfree in of_pci_get_host_bridge_resources
Date: Thu, 12 Feb 2015 05:00:09 +0100 [thread overview]
Message-ID: <7358500.qEktYExvcf@vostro.rjw.lan> (raw)
In-Reply-To: <20150211225057.GA16317@google.com>
On Wednesday, February 11, 2015 04:50:57 PM Bjorn Helgaas wrote:
> On Wed, Feb 11, 2015 at 04:58:35AM +0000, Lorenzo Pieralisi wrote:
> > Commit d2be00c0fb5a ("of/pci: Free resources on failure in
> > of_pci_get_host_bridge_resources()") fixed the error code path in
> > of_pci_get_host_bridge_resources() by adding code that runs through the
> > resources list to free all resources in it and then calls kfree on the
> > bus_range resource pointer to complete the memory deallocation.
> > Since the bus_range resource is added to the resources list through
> > pci_add_resource, the resource_list_for_each_entry loop in the error
> > exit path frees it already and freeing it anew could trigger a double
> > free, hence this patch removes the superfluos kfree call on the bus_range
> > resource.
> >
> > Fixes: d2be00c0fb5a ("of/pci: Free resources on failure in of_pci_get_host_bridge_resources()")
> > Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Reported-by: Jiang Liu <jiang.liu@linux.intel.com>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
>
> I applied this to for-linus, and will ask Linus to put it in before
> v3.20-rc1, thanks!
>
> Rafael, I applied d2be00c0fb5a, where the bug originally came from, but I
> see that you fixed it with 5c493df25a0d and the fix got lost because of an
> incorrect merge resolution. So if you'd rather take this, just let me
> know.
That really should go through your tree I think. I attempted to fix it, but
failed to do that correctly, so effectively that doesn't count ...
Rafael
prev parent reply other threads:[~2015-02-12 3:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-11 4:58 [PATCH] drivers: of: pci: remove duplicate kfree in of_pci_get_host_bridge_resources Lorenzo Pieralisi
2015-02-11 22:50 ` Bjorn Helgaas
2015-02-12 4:00 ` Rafael J. Wysocki [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=7358500.qEktYExvcf@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=bhelgaas@google.com \
--cc=jiang.liu@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.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