diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-04-09 20:51:18 +0200 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-04-17 22:27:37 +0200 |
commit | 0b6c4857f7684f6d3f59e0506f62953575346978 (patch) | |
tree | c266c9232022a962f1cb868d0f3664074efa2134 /include/linux/firewire.h | |
parent | fe2af11c220c7bb3a67f7aec0594811e5c59e019 (diff) | |
download | linux-stable-0b6c4857f7684f6d3f59e0506f62953575346978.tar.gz linux-stable-0b6c4857f7684f6d3f59e0506f62953575346978.tar.bz2 linux-stable-0b6c4857f7684f6d3f59e0506f62953575346978.zip |
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>
Diffstat (limited to 'include/linux/firewire.h')
-rw-r--r-- | include/linux/firewire.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index cdc9b719e9c7..0a1905719f6f 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h @@ -391,6 +391,7 @@ struct fw_iso_buffer { enum dma_data_direction direction; struct page **pages; int page_count; + int page_count_mapped; }; int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, |