svn commit: r248657 - head/sys/dev/drm2/ttm

Jean-Sebastien Pedron dumbbell at FreeBSD.org
Sat Mar 23 19:19:19 UTC 2013


Author: dumbbell
Date: Sat Mar 23 19:19:19 2013
New Revision: 248657
URL: http://svnweb.freebsd.org/changeset/base/248657

Log:
  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 <jr at opal.com>

Modified:
  head/sys/dev/drm2/ttm/ttm_bo_vm.c

Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c
==============================================================================
--- head/sys/dev/drm2/ttm/ttm_bo_vm.c	Sat Mar 23 19:04:57 2013	(r248656)
+++ head/sys/dev/drm2/ttm/ttm_bo_vm.c	Sat Mar 23 19:19:19 2013	(r248657)
@@ -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);
 }
 


More information about the svn-src-all mailing list