浏览代码

firewire: ohci: release channel in error path

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>
Stefan Richter 15 年之前
父节点
当前提交
e5b06c077c
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/firewire/ohci.c

+ 1 - 0
drivers/firewire/ohci.c

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