LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/6] PCI: Fix memory leak of devm_pci_alloc_host_bridge
Date: Tue, 24 Apr 2018 17:13:38 +0200 [thread overview]
Message-ID: <2a083b46d55687d01d43d4013cfb957cb3720db5.1524582822.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1524582822.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1524582822.git.jan.kiszka@siemens.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
devm_pci_release_host_bridge_dev failed to release the resource list.
Fixes: 5c3f18cce083 ("PCI: Add devm_pci_alloc_host_bridge() interface")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
drivers/pci/probe.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index ac91b6fd0bcd..eccf204c9160 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -526,12 +526,14 @@ static void devm_pci_release_host_bridge_dev(struct device *dev)
if (bridge->release_fn)
bridge->release_fn(bridge);
+
+ pci_free_resource_list(&bridge->windows);
}
static void pci_release_host_bridge_dev(struct device *dev)
{
devm_pci_release_host_bridge_dev(dev);
- pci_free_host_bridge(to_pci_host_bridge(dev));
+ kfree(to_pci_host_bridge(dev));
}
struct pci_host_bridge *pci_alloc_host_bridge(size_t priv)
--
2.13.6
next prev parent reply other threads:[~2018-04-24 15:21 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-24 15:13 [PATCH 0/6] PCI: leak fixes, removable generic PCI host, assorted stuff Jan Kiszka
2018-04-24 15:13 ` [PATCH 1/6] PCI: Make pci_get_new_domain_nr static Jan Kiszka
2018-04-25 16:27 ` Lorenzo Pieralisi
2018-04-25 17:21 ` Jan Kiszka
2018-04-24 15:13 ` Jan Kiszka [this message]
2018-04-24 15:13 ` [PATCH 3/6] PCI: Introduce devm_of_pci_get_host_bridge_resources Jan Kiszka
2018-04-25 10:40 ` Jan Kiszka
2018-04-27 22:24 ` Bjorn Helgaas
2018-04-28 7:28 ` Jan Kiszka
2018-04-30 18:40 ` Bjorn Helgaas
2018-04-30 18:43 ` Sinan Kaya
2018-05-02 5:39 ` Jan Kiszka
2018-04-24 15:13 ` [PATCH 4/6] PCI: Convert of_pci_get_host_bridge_resources users to devm variant Jan Kiszka
2018-04-25 19:47 ` Jingoo Han
2018-04-24 15:13 ` [PATCH 5/6] PCI: Add support for unbinding the generic PCI host controller Jan Kiszka
2018-04-24 15:13 ` [PATCH 6/6] arm: Allow to enable PCI_DOMAINS manually Jan Kiszka
2018-04-25 17:54 ` Lorenzo Pieralisi
2018-04-26 7:19 ` Jan Kiszka
2018-04-27 22:16 ` [PATCH 0/6] PCI: leak fixes, removable generic PCI host, assorted stuff Bjorn Helgaas
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=2a083b46d55687d01d43d4013cfb957cb3720db5.1524582822.git.jan.kiszka@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=bhelgaas@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--subject='Re: [PATCH 2/6] PCI: Fix memory leak of devm_pci_alloc_host_bridge' \
/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
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).