Commit 9eef6a5c authored by Rolf Evers-Fischer's avatar Rolf Evers-Fischer Committed by Lorenzo Pieralisi

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: 5e8cb403 ("PCI: endpoint: Add EP core layer to enable EP controller and EP functions")
Signed-off-by: default avatarRolf Evers-Fischer <rolf.evers.fischer@aptiv.com>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
parent 36cc14ac
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment