From: Ladislav Michl <ladis@linux-mips.org>
To: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Wolfram Sang <w.sang@pengutronix.de>,
Bjorn Helgaas <bhelgaas@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 2/2] PCI: Fix double mem region release in devm_pci_remap_cfg_resource()
Date: Fri, 19 Jan 2018 19:05:04 +0100 [thread overview]
Message-ID: <20180119180504.GC31540@lenoch> (raw)
In-Reply-To: <20180119180310.GA31540@lenoch>
devm_release_mem_region() is called explicitely in case
devm_pci_remap_cfgspace() fails, however the same release
function is later called also as devres release of
devm_request_mem_region() causing double resource free.
Fixes: 490cb6ddb17d ("PCI: Implement devm_pci_remap_cfgspace()")
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
drivers/pci/pci.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 764ca7b8840d..8f9d81a23ca5 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3607,7 +3607,6 @@ void __iomem *devm_pci_remap_cfg_resource(struct device *dev,
dest_ptr = devm_pci_remap_cfgspace(dev, res->start, size);
if (!dest_ptr) {
dev_err(dev, "ioremap failed for resource %pR\n", res);
- devm_release_mem_region(dev, res->start, size);
dest_ptr = IOMEM_ERR_PTR(-ENOMEM);
}
--
2.15.1
next prev parent reply other threads:[~2018-01-19 18:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 18:03 [PATCH 0/2] Fix double mem region release Ladislav Michl
2018-01-19 18:04 ` [PATCH 1/2] devres: Fix double mem region release in devm_ioremap_resource() Ladislav Michl
2018-01-19 18:05 ` Ladislav Michl [this message]
2018-01-19 23:36 ` [PATCH 0/2] Fix double mem region release Ladislav Michl
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=20180119180504.GC31540@lenoch \
--to=ladis@linux-mips.org \
--cc=bhelgaas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=w.sang@pengutronix.de \
/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 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.