PCI: endpoint: Use after free in pci_epf_unregister_driver()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 29 Jun 2018 18:49:24 +0000 (13:49 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 29 Jun 2018 18:49:24 +0000 (13:49 -0500)
commitfb0de5b8dcc68da4a0d39b0f5fcd5368085ad7c1
tree5612b376ed6aaa45ea6b924b61d11a35ecad3f01
parent9bc5f0833a55c7bf768d517b5fdcf89ead43b794
PCI: endpoint: Use after free in pci_epf_unregister_driver()

We need to use list_for_each_entry_safe() because the
pci_ep_cfs_remove_epf_group() function frees "group".

Fixes: ef1433f717a2 ("PCI: endpoint: Create configfs entry for each pci_epf_device_id table entry")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[lorenzo.pieralisi@arm.com: updated commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/pci/endpoint/pci-epf-core.c