firewire: core: fix DMA mapping direction
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Mon, 9 Apr 2012 18:51:18 +0000 (20:51 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 17 Apr 2012 20:27:37 +0000 (22:27 +0200)
commit0b6c4857f7684f6d3f59e0506f62953575346978
treec266c9232022a962f1cb868d0f3664074efa2134
parentfe2af11c220c7bb3a67f7aec0594811e5c59e019
firewire: core: fix DMA mapping direction

Seen with recent libdc1394:  If a client mmap()s the buffer of an
isochronous reception buffer with PROT_READ|PROT_WRITE instead of just
PROT_READ, firewire-core sets the wrong DMA mapping direction during
buffer initialization.

The fix is to split fw_iso_buffer_init() into allocation and DMA mapping
and to perform the latter after both buffer and DMA context were
allocated.  Buffer allocation and context allocation may happen in any
order, but we need the context type (reception or transmission) in order
to set the DMA direction of the buffer.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/core-cdev.c
drivers/firewire/core-iso.c
drivers/firewire/core.h
include/linux/firewire.h
This page took 0.045171 seconds and 5 git commands to generate.