Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Mar 2013 18:11:02 +0000 (UTC)
From:      Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r248060 - in head/sys/dev/drm2: . ttm
Message-ID:  <201303081811.r28IB2JI009017@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dumbbell
Date: Fri Mar  8 18:11:02 2013
New Revision: 248060
URL: http://svnweb.freebsd.org/changeset/base/248060

Log:
  drm: Fix a call to free(9) with an incorrect malloc type
  
  While here, the call to free(9) is moved to drm_global.c, near the
  initial malloc(9).
  
  Reviewed by:	Konstantin Belousov (kib@)

Modified:
  head/sys/dev/drm2/drm_global.c
  head/sys/dev/drm2/ttm/ttm_bo.c
  head/sys/dev/drm2/ttm/ttm_memory.c

Modified: head/sys/dev/drm2/drm_global.c
==============================================================================
--- head/sys/dev/drm2/drm_global.c	Fri Mar  8 18:08:12 2013	(r248059)
+++ head/sys/dev/drm2/drm_global.c	Fri Mar  8 18:11:02 2013	(r248060)
@@ -104,6 +104,7 @@ void drm_global_item_unref(struct drm_gl
 	MPASS(ref->object == item->object);
 	if (--item->refcount == 0) {
 		ref->release(ref);
+		free(item->object, M_DRM_GLOBAL);
 		item->object = NULL;
 	}
 	sx_xunlock(&item->mutex);

Modified: head/sys/dev/drm2/ttm/ttm_bo.c
==============================================================================
--- head/sys/dev/drm2/ttm/ttm_bo.c	Fri Mar  8 18:08:12 2013	(r248059)
+++ head/sys/dev/drm2/ttm/ttm_bo.c	Fri Mar  8 18:11:02 2013	(r248060)
@@ -1400,7 +1400,6 @@ static void ttm_bo_global_kobj_release(s
 
 	ttm_mem_unregister_shrink(glob->mem_glob, &glob->shrink);
 	vm_page_free(glob->dummy_read_page);
-	free(glob, M_DRM_GLOBAL);
 }
 
 void ttm_bo_global_release(struct drm_global_reference *ref)

Modified: head/sys/dev/drm2/ttm/ttm_memory.c
==============================================================================
--- head/sys/dev/drm2/ttm/ttm_memory.c	Fri Mar  8 18:08:12 2013	(r248059)
+++ head/sys/dev/drm2/ttm/ttm_memory.c	Fri Mar  8 18:11:02 2013	(r248060)
@@ -125,8 +125,6 @@ static ssize_t ttm_mem_zone_store(struct
 
 static void ttm_mem_global_kobj_release(struct ttm_mem_global *glob)
 {
-
-	free(glob, M_TTM_ZONE);
 }
 
 static bool ttm_zones_above_swap_target(struct ttm_mem_global *glob,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303081811.r28IB2JI009017>