firewire: ohci: release channel in error path
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Wed, 28 Jul 2010 13:50:00 +0000 (15:50 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Thu, 29 Jul 2010 21:06:25 +0000 (23:06 +0200)
firewire-ohci keeps book of which isochronous channels are occupied by
IR DMA contexts, so that there cannot be more than one context listening
to a certain channel.

If IR context creation failed due to an out-of-memory condition, this
bookkeeping leaked a channel.

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

index 3f59d1df6504d8af232bc30756ea135113db7761..2e4b425847a77bfdc4f1b04975f259a79b809aca 100644 (file)
@@ -2309,6 +2309,7 @@ static struct fw_iso_context *ohci_allocate_iso_context(struct fw_card *card,
        free_page((unsigned long)ctx->header);
  out:
        spin_lock_irqsave(&ohci->lock, flags);
+       *channels |= 1ULL << channel;
        *mask |= 1 << index;
        spin_unlock_irqrestore(&ohci->lock, flags);