From 6dc9bf62e8bf4d669e2e1e8cd1b815b2367d9978 Mon Sep 17 00:00:00 2001 From: dumbbell Date: Sat, 23 Mar 2013 19:19:19 +0000 Subject: drm/ttm: Fix TTM buffer object refcount This fixes memory leaks in the radeonkms driver. Reviewed by: Konstantin Belousov (kib@) Tested by: J.R. Oldroyd --- sys/dev/drm2/ttm/ttm_bo_vm.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'sys/dev/drm2') diff --git a/sys/dev/drm2/ttm/ttm_bo_vm.c b/sys/dev/drm2/ttm/ttm_bo_vm.c index 3eb4cc7..1c86d95 100644 --- a/sys/dev/drm2/ttm/ttm_bo_vm.c +++ b/sys/dev/drm2/ttm/ttm_bo_vm.c @@ -122,9 +122,7 @@ retry: m = NULL; reserve: - mtx_lock(&bo->glob->lru_lock); - ret = ttm_bo_reserve_locked(bo, false, false, false, 0); - mtx_unlock(&bo->glob->lru_lock); + ret = ttm_bo_reserve(bo, false, false, false, 0); if (unlikely(ret != 0)) { if (ret == -EBUSY) { kern_yield(0); @@ -253,10 +251,8 @@ static int ttm_bo_vm_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred, u_short *color) { - struct ttm_buffer_object *bo = handle; *color = 0; - (void)ttm_bo_reference(bo); return (0); } -- cgit v1.1