[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180228173220.544-3-embedded24@evers-fischer.de>
Date: Wed, 28 Feb 2018 18:32:19 +0100
From: Rolf Evers-Fischer <embedded24@...rs-fischer.de>
To: kishon@...com
Cc: lorenzo.pieralisi@....com, bhelgaas@...gle.com,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
andy.shevchenko@...il.com,
Rolf Evers-Fischer <rolf.evers.fischer@...iv.com>
Subject: [PATCH v5 2/3] PCI: endpoint: Fix kernel panic after put_device()
From: Rolf Evers-Fischer <rolf.evers.fischer@...iv.com>
'put_device()' calls the relase function 'pci_epf_dev_release()',
which already frees 'epf->name' and 'epf'.
Therefore we must not free them again after 'put_device()'.
Fixes: 5e8cb4033807 ("PCI: endpoint: Add EP core layer to enable EP controller and EP functions")
Signed-off-by: Rolf Evers-Fischer <rolf.evers.fischer@...iv.com>
Acked-by: Kishon Vijay Abraham I <kishon@...com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>
---
drivers/pci/endpoint/pci-epf-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c
index 1f2506f32bb9..1878a6776519 100644
--- a/drivers/pci/endpoint/pci-epf-core.c
+++ b/drivers/pci/endpoint/pci-epf-core.c
@@ -232,7 +232,7 @@ struct pci_epf *pci_epf_create(const char *name)
put_dev:
put_device(dev);
- kfree(epf->name);
+ return ERR_PTR(ret);
free_epf:
kfree(epf);
--
2.16.2
Powered by blists - more mailing lists