]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
firewire: ohci: prevent iso completion callbacks after context stop
authorClemens Ladisch <clemens@ladisch.de>
Wed, 16 Feb 2011 09:32:11 +0000 (10:32 +0100)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Sat, 26 Feb 2011 14:11:03 +0000 (15:11 +0100)
To prevent the iso packet callback from being called after
fw_iso_context_stop() has returned, make sure that the
context's tasklet has finished executing before that.

This fixes access-after-free bugs that have so far been
observed only in the upcoming snd-firewire-speakers driver,
but can theoretically also happen in the firedtv driver.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/ohci.c

index c7394361afcb1c7a0d8ff5a5eb2c1416679c6f1e..f1497b1fcf2e738b81264307470daa7ef536f7e9 100644 (file)
@@ -2764,6 +2764,7 @@ static int ohci_stop_iso(struct fw_iso_context *base)
        }
        flush_writes(ohci);
        context_stop(&ctx->context);
+       tasklet_kill(&ctx->context.tasklet);
 
        return 0;
 }