summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2023-10-25 14:57:23 +0300
committerBjorn Helgaas <bhelgaas@google.com>2023-10-26 11:12:16 -0500
commitc9501d268944d6c0475ecb3e740a084a7da9cbfe (patch)
treea29ca88059b654a5dcf71105c41bec6dc7b11e9b /drivers/pci
parent43b0294abaceec20943c4ae222a0839b353a055f (diff)
PCI: endpoint: Fix double free in __pci_epc_create()
The pci_epc_release() function frees "epc" so the kfree() on the next line is a double free. Drop the redundant free. Fixes: 7711cbb4862a ("PCI: endpoint: Fix WARN() when an endpoint driver is removed") Link: https://lore.kernel.org/r/2ce68694-87a7-4c06-b8a4-9870c891b580@moroto.mountain Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/endpoint/pci-epc-core.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
index 5a4a8b0be626..a7d3a92391a4 100644
--- a/drivers/pci/endpoint/pci-epc-core.c
+++ b/drivers/pci/endpoint/pci-epc-core.c
@@ -869,7 +869,6 @@ __pci_epc_create(struct device *dev, const struct pci_epc_ops *ops,
put_dev:
put_device(&epc->dev);
- kfree(epc);
err_ret:
return ERR_PTR(ret);