diff options
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r-- | drivers/ieee1394/dma.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/ieee1394/dma.c b/drivers/ieee1394/dma.c index ec024b5d5e5e..73685e7dc7e4 100644 --- a/drivers/ieee1394/dma.c +++ b/drivers/ieee1394/dma.c | |||
@@ -231,28 +231,20 @@ void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset, | |||
231 | 231 | ||
232 | #ifdef CONFIG_MMU | 232 | #ifdef CONFIG_MMU |
233 | 233 | ||
234 | /* fault() handler for mmap access */ | ||
235 | |||
236 | static int dma_region_pagefault(struct vm_area_struct *vma, | 234 | static int dma_region_pagefault(struct vm_area_struct *vma, |
237 | struct vm_fault *vmf) | 235 | struct vm_fault *vmf) |
238 | { | 236 | { |
239 | unsigned long kernel_virt_addr; | ||
240 | |||
241 | struct dma_region *dma = (struct dma_region *)vma->vm_private_data; | 237 | struct dma_region *dma = (struct dma_region *)vma->vm_private_data; |
242 | 238 | ||
243 | if (!dma->kvirt) | 239 | if (!dma->kvirt) |
244 | goto error; | 240 | return VM_FAULT_SIGBUS; |
245 | 241 | ||
246 | if (vmf->pgoff >= dma->n_pages) | 242 | if (vmf->pgoff >= dma->n_pages) |
247 | goto error; | 243 | return VM_FAULT_SIGBUS; |
248 | 244 | ||
249 | kernel_virt_addr = (unsigned long)dma->kvirt + (vmf->pgoff << PAGE_SHIFT); | 245 | vmf->page = vmalloc_to_page(dma->kvirt + (vmf->pgoff << PAGE_SHIFT)); |
250 | vmf->page = vmalloc_to_page((void *)kernel_virt_addr); | ||
251 | get_page(vmf->page); | 246 | get_page(vmf->page); |
252 | return 0; | 247 | return 0; |
253 | |||
254 | error: | ||
255 | return VM_FAULT_SIGBUS; | ||
256 | } | 248 | } |
257 | 249 | ||
258 | static struct vm_operations_struct dma_region_vm_ops = { | 250 | static struct vm_operations_struct dma_region_vm_ops = { |