From 85ee2a8d044cd4d8de4894a794151af9471648e3 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Sat, 10 Feb 2007 12:06:36 +0100 Subject: Various bugfixes. --- linux-core/drm_vm.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'linux-core/drm_vm.c') diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c index 4a41e761..17778c26 100644 --- a/linux-core/drm_vm.c +++ b/linux-core/drm_vm.c @@ -746,6 +746,14 @@ struct page *drm_bo_vm_fault(struct vm_area_struct *vma, mutex_lock(&bo->mutex); + err = drm_bo_wait(bo, 0, 0, 0); + if (err) { + data->type = (err == -EAGAIN) ? + VM_FAULT_MINOR : VM_FAULT_SIGBUS; + goto out_unlock; + } + + /* * If buffer happens to be in a non-mappable location, * move it to a mappable. @@ -760,16 +768,13 @@ struct page *drm_bo_vm_fault(struct vm_area_struct *vma, err = drm_bo_move_buffer(bo, new_mask, 0, 0); bo->mem.mask = mask_save; - if (!err) - err = drm_bo_wait(bo, 0, 0, 0); - if (err) { data->type = (err == -EAGAIN) ? VM_FAULT_MINOR : VM_FAULT_SIGBUS; goto out_unlock; } } - + if (address > vma->vm_end) { data->type = VM_FAULT_SIGBUS; goto out_unlock; -- cgit v1.2.3