Skip to content

Commit c9501d2

Browse files
Dan Carpenterbjorn-helgaas
authored andcommitted
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: 7711cbb ("PCI: endpoint: Fix WARN() when an endpoint driver is removed") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]>
1 parent 43b0294 commit c9501d2

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/pci/endpoint/pci-epc-core.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,6 @@ __pci_epc_create(struct device *dev, const struct pci_epc_ops *ops,
869869

870870
put_dev:
871871
put_device(&epc->dev);
872-
kfree(epc);
873872

874873
err_ret:
875874
return ERR_PTR(ret);

0 commit comments

Comments
 (0)