Don't free object while information in them are used for accounting purposes.

Fix by Alan Hourihane.
This commit is contained in:
Thomas Hellstrom 2009-01-21 14:11:11 +01:00
parent 2eb3922aa6
commit 72f10b46d4
3 changed files with 5 additions and 5 deletions

View file

@ -70,8 +70,8 @@ static void ttm_bo_release_list(struct kref *list_kref)
if (bo->destroy)
bo->destroy(bo);
else {
kfree(bo);
ttm_mem_global_free(bdev->mem_glob, bo->acc_size, 0);
kfree(bo);
}
}

View file

@ -266,8 +266,8 @@ int ttm_ref_object_add(struct ttm_object_file *tfile,
write_unlock(&tfile->lock);
BUG_ON(ret != -EINVAL);
kfree(ref);
ttm_mem_global_free(mem_glob, sizeof(*ref), 0);
kfree(ref);
}
return ret;
@ -291,8 +291,8 @@ static void ttm_ref_object_release(struct kref *kref)
base->ref_obj_release(base, ref->ref_type);
ttm_base_object_unref(&ref->obj);
kfree(ref);
ttm_mem_global_free(mem_glob, sizeof(*ref), 0);
kfree(ref);
write_lock(&tfile->lock);
}

View file

@ -97,8 +97,8 @@ static void ttm_bo_user_destroy(struct ttm_buffer_object *bo)
struct ttm_bo_user_object *user_bo =
container_of(bo, struct ttm_bo_user_object, bo);
kfree(user_bo);
ttm_mem_global_free(bo->bdev->mem_glob, bo->acc_size, 0);
kfree(user_bo);
}
static void ttm_bo_user_release(struct ttm_base_object **p_base)
@ -176,8 +176,8 @@ int ttm_pl_create_ioctl(struct ttm_object_file *tfile,
bo = &user_bo->bo;
ret = ttm_read_lock(lock, true);
if (unlikely(ret != 0)) {
kfree(user_bo);
ttm_mem_global_free(mem_glob, acc_size, 0);
kfree(user_bo);
return ret;
}