mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
PCI/PME: Fix possible use-after-free on remove
In remove(), ensure that the PME work cannot run after kfree() is called. Otherwise, this could result in a use-after-free. This issue was detected with the help of Coccinelle. Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Sinan Kaya <okaya@kernel.org> Cc: Frederick Lawler <fred@fredlawl.com> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Keith Busch <keith.busch@intel.com> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
95c80bc695
commit
7cf58b79b3
@ -437,6 +437,7 @@ static void pcie_pme_remove(struct pcie_device *srv)
|
||||
|
||||
pcie_pme_disable_interrupt(srv->port, data);
|
||||
free_irq(srv->irq, srv);
|
||||
cancel_work_sync(&data->work);
|
||||
kfree(data);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user