summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@jsg.id.au>2013-06-05 15:46:25 +1000
committerJonathan Gray <jsg@jsg.id.au>2013-08-12 10:41:58 +1000
commitb7e237e612ceabcb55b197287a575847fdf2edd2 (patch)
treec36e420ef71dd37ad9f7118706c8064aac9d7c8d /sys
parent824cf100f780127d8b945b13e823b111c3ba041c (diff)
inc the bo refcount in ttm_bo_mmap
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/ttm/ttm_bo_vm.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/pci/drm/ttm/ttm_bo_vm.c b/sys/dev/pci/drm/ttm/ttm_bo_vm.c
index 892aedc72ed..c393d2602bc 100644
--- a/sys/dev/pci/drm/ttm/ttm_bo_vm.c
+++ b/sys/dev/pci/drm/ttm/ttm_bo_vm.c
@@ -299,10 +299,8 @@ ttm_bo_mmap(voff_t off, vsize_t size, struct ttm_bo_device *bdev)
rw_enter_read(&bdev->vm_lock);
bo = ttm_bo_vm_lookup_rb(bdev, off >> PAGE_SHIFT, size >> PAGE_SHIFT);
-#if 0
- if (likely(bo != NULL) && !kref_get_unless_zero(&bo->kref))
- bo = NULL;
-#endif
+ if (likely(bo != NULL))
+ refcount_acquire(&bo->kref);
rw_exit_read(&bdev->vm_lock);
if (unlikely(bo == NULL)) {