Skip to content

Commit

Permalink
RDMA/nes: Free IRQ before killing tasklet
Browse files Browse the repository at this point in the history
Move the free_irq() call in nes_remove() to before the tasklet_kill();
otherwise there is a window after tasklet_kill() where a new interrupt
can be handled and reschedule the tasklet, leading to a use-after-free
crash.

Cc: <stable@kernel.org>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed Apr 17, 2008
1 parent 940801b commit 4cd1e5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/nes/nes.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,13 +744,13 @@ static void __devexit nes_remove(struct pci_dev *pcidev)

list_del(&nesdev->list);
nes_destroy_cqp(nesdev);

free_irq(pcidev->irq, nesdev);
tasklet_kill(&nesdev->dpc_tasklet);

/* Deallocate the Adapter Structure */
nes_destroy_adapter(nesdev->nesadapter);

free_irq(pcidev->irq, nesdev);

if (nesdev->msi_enabled) {
pci_disable_msi(pcidev);
}
Expand Down

0 comments on commit 4cd1e5e

Please sign in to comment.