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 Cc: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Subject: [PATCH v4 2/8] PCI: Fix memory leak of devm_pci_alloc_host_bridge() Date: Tue, 15 May 2018 11:07:01 +0200 [thread overview] Message-ID: <b8a0bde43293c275094df6d3611cd401353d7f12.1526375226.git.jan.kiszka@siemens.com> (raw) In-Reply-To: <cover.1526375226.git.jan.kiszka@siemens.com> In-Reply-To: <cover.1526375226.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
WARNING: multiple messages have this Message-ID (diff)
From: jan.kiszka@siemens.com (Jan Kiszka) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 2/8] PCI: Fix memory leak of devm_pci_alloc_host_bridge() Date: Tue, 15 May 2018 11:07:01 +0200 [thread overview] Message-ID: <b8a0bde43293c275094df6d3611cd401353d7f12.1526375226.git.jan.kiszka@siemens.com> (raw) In-Reply-To: <cover.1526375226.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-05-15 9:08 UTC|newest] Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-05-15 9:06 [PATCH v4 0/8] PCI: leak fixes, removable generic PCI host, assorted stuff Jan Kiszka 2018-05-15 9:06 ` Jan Kiszka 2018-05-15 9:07 ` [PATCH v4 1/8] PCI: Make pci_get_new_domain_nr() static Jan Kiszka 2018-05-15 9:07 ` Jan Kiszka 2018-05-15 9:07 ` Jan Kiszka [this message] 2018-05-15 9:07 ` [PATCH v4 2/8] PCI: Fix memory leak of devm_pci_alloc_host_bridge() Jan Kiszka 2018-05-15 9:07 ` [PATCH v4 3/8] PCI: Rename device node parameter of of_pci_get_host_bridge_resources() Jan Kiszka 2018-05-15 9:07 ` Jan Kiszka 2018-05-15 9:07 ` Jan Kiszka 2018-05-15 10:04 ` Vladimir Zapolskiy 2018-05-15 10:04 ` Vladimir Zapolskiy 2018-05-15 9:07 ` [PATCH v4 4/8] PCI: Replace dev_node parameter of of_pci_get_host_bridge_resources with device Jan Kiszka 2018-05-15 9:07 ` Jan Kiszka 2018-05-15 9:07 ` Jan Kiszka 2018-05-15 10:05 ` Vladimir Zapolskiy 2018-05-15 10:05 ` Vladimir Zapolskiy 2018-05-15 15:34 ` Jingoo Han 2018-05-15 15:34 ` Jingoo Han 2018-05-15 15:34 ` Jingoo Han 2018-05-28 10:00 ` Vladimir Zapolskiy 2018-05-28 10:00 ` Vladimir Zapolskiy 2018-05-28 10:00 ` Vladimir Zapolskiy 2018-05-28 10:46 ` Jan Kiszka 2018-05-28 10:46 ` Jan Kiszka 2018-05-28 10:46 ` Jan Kiszka 2018-05-29 13:20 ` Bjorn Helgaas 2018-05-29 13:20 ` Bjorn Helgaas 2018-05-15 9:07 ` [PATCH v4 5/8] PCI: Replace pr_*() with dev_*() in of_pci_get_host_bridge_resources() Jan Kiszka 2018-05-15 9:07 ` Jan Kiszka 2018-05-15 10:05 ` Vladimir Zapolskiy 2018-05-15 10:05 ` Vladimir Zapolskiy 2018-05-15 9:07 ` [PATCH v4 6/8] PCI: Rework of_pci_get_host_bridge_resources() to devm_of_pci_get_host_bridge_resources() Jan Kiszka 2018-05-15 9:07 ` Jan Kiszka 2018-05-15 10:06 ` Vladimir Zapolskiy 2018-05-15 10:06 ` Vladimir Zapolskiy 2018-05-15 14:28 ` Joao Pinto 2018-05-15 14:28 ` Joao Pinto 2018-05-15 14:28 ` Joao Pinto 2018-05-15 15:31 ` Jingoo Han 2018-05-15 15:31 ` Jingoo Han 2018-05-15 15:31 ` Jingoo Han 2018-05-15 16:48 ` Andy Shevchenko 2018-05-15 16:48 ` Andy Shevchenko 2018-05-15 16:48 ` Andy Shevchenko 2018-05-15 16:50 ` Andy Shevchenko 2018-05-15 16:50 ` Andy Shevchenko 2018-05-15 16:50 ` Andy Shevchenko 2018-05-16 12:31 ` [PATCH] PCI: Clean up resource allocation in devm_of_pci_get_host_bridge_resources() Jan Kiszka 2018-05-16 12:31 ` Jan Kiszka 2018-05-17 6:23 ` Vladimir Zapolskiy 2018-05-17 6:23 ` Vladimir Zapolskiy 2018-06-05 16:26 ` Andy Shevchenko 2018-06-05 16:26 ` Andy Shevchenko 2018-06-05 20:44 ` Bjorn Helgaas 2018-06-05 20:44 ` Bjorn Helgaas 2018-06-05 20:44 ` Bjorn Helgaas 2018-06-29 23:30 ` Bjorn Helgaas 2018-06-29 23:30 ` Bjorn Helgaas 2018-06-29 23:30 ` Bjorn Helgaas 2018-05-15 9:07 ` [PATCH v4 7/8] PCI: Add support for unbinding the generic PCI host controller Jan Kiszka 2018-05-15 9:07 ` Jan Kiszka 2018-05-15 9:07 ` [PATCH v4 8/8] PCI: Enable PCI_DOMAINS along with " Jan Kiszka 2018-05-15 9:07 ` Jan Kiszka 2018-05-15 19:00 ` [PATCH v4 0/8] PCI: leak fixes, removable generic PCI host, assorted stuff Bjorn Helgaas 2018-05-15 19:00 ` Bjorn Helgaas 2018-05-15 19:00 ` 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=b8a0bde43293c275094df6d3611cd401353d7f12.1526375226.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 \ --cc=vladimir_zapolskiy@mentor.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.