diff options
author | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2013-03-08 18:11:02 +0000 |
---|---|---|
committer | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2013-03-08 18:11:02 +0000 |
commit | 3f81c677461757d14cb855f74d146695e31316a2 (patch) | |
tree | 998d4448a2bc13c48bb654a93966f516957b3c02 | |
parent | 1f14e0cb94970d153670dbe485190bff954a1e1e (diff) | |
download | src-3f81c677461757d14cb855f74d146695e31316a2.tar.gz src-3f81c677461757d14cb855f74d146695e31316a2.zip |
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@)
Notes
Notes:
svn path=/head/; revision=248060
-rw-r--r-- | sys/dev/drm2/drm_global.c | 1 | ||||
-rw-r--r-- | sys/dev/drm2/ttm/ttm_bo.c | 1 | ||||
-rw-r--r-- | sys/dev/drm2/ttm/ttm_memory.c | 2 |
3 files changed, 1 insertions, 3 deletions
diff --git a/sys/dev/drm2/drm_global.c b/sys/dev/drm2/drm_global.c index 992d0613c7c6..637204490cd0 100644 --- a/sys/dev/drm2/drm_global.c +++ b/sys/dev/drm2/drm_global.c @@ -104,6 +104,7 @@ void drm_global_item_unref(struct drm_global_reference *ref) 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); diff --git a/sys/dev/drm2/ttm/ttm_bo.c b/sys/dev/drm2/ttm/ttm_bo.c index 12e51317546f..9cb9336ea7f4 100644 --- a/sys/dev/drm2/ttm/ttm_bo.c +++ b/sys/dev/drm2/ttm/ttm_bo.c @@ -1400,7 +1400,6 @@ static void ttm_bo_global_kobj_release(struct ttm_bo_global *glob) 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) diff --git a/sys/dev/drm2/ttm/ttm_memory.c b/sys/dev/drm2/ttm/ttm_memory.c index ee74d94dfdbc..dc85656286a1 100644 --- a/sys/dev/drm2/ttm/ttm_memory.c +++ b/sys/dev/drm2/ttm/ttm_memory.c @@ -125,8 +125,6 @@ static ssize_t ttm_mem_zone_store(struct ttm_mem_zone *zone, 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, |