diff options
author | Rolf Evers-Fischer <[email protected]> | 2018-02-28 18:32:19 +0100 |
---|---|---|
committer | Lorenzo Pieralisi <[email protected]> | 2018-03-01 11:58:45 +0000 |
commit | 9eef6a5c3b0bf90eb292d462ea267bcb6ad1c334 (patch) | |
tree | 41fb038470c705bb6b4195683cd21113af681499 | |
parent | 36cc14ac14c0d49d33820a82dab52a7edc802fef (diff) |
PCI: endpoint: Fix kernel panic after put_device()
'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 <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
Acked-by: Kishon Vijay Abraham I <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
-rw-r--r-- | drivers/pci/endpoint/pci-epf-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |