Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163923
b: refs/heads/master
c: 5fd9cba
h: refs/heads/master
i:
  163921: 9a76c60
  163919: 19cfb3f
v: v3
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Aug 19, 2009
1 parent 9d92399 commit 2296974
Show file tree
Hide file tree
Showing 7 changed files with 454 additions and 120 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9840be8c23601285a70520b4898818f28ce8c2b
refs/heads/master: 5fd9cbad3a4ae82c83c55b9c621d156c326724ef
6 changes: 3 additions & 3 deletions trunk/drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static void ttm_bo_release_list(struct kref *list_kref)
if (bo->destroy)
bo->destroy(bo);
else {
ttm_mem_global_free(bdev->mem_glob, bo->acc_size, false);
ttm_mem_global_free(bdev->mem_glob, bo->acc_size);
kfree(bo);
}
}
Expand Down Expand Up @@ -1065,14 +1065,14 @@ int ttm_buffer_object_create(struct ttm_bo_device *bdev,

size_t acc_size =
ttm_bo_size(bdev, (size + PAGE_SIZE - 1) >> PAGE_SHIFT);
ret = ttm_mem_global_alloc(mem_glob, acc_size, false, false, false);
ret = ttm_mem_global_alloc(mem_glob, acc_size, false, false);
if (unlikely(ret != 0))
return ret;

bo = kzalloc(sizeof(*bo), GFP_KERNEL);

if (unlikely(bo == NULL)) {
ttm_mem_global_free(mem_glob, acc_size, false);
ttm_mem_global_free(mem_glob, acc_size);
return -ENOMEM;
}

Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/gpu/drm/ttm/ttm_global.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int ttm_global_item_ref(struct ttm_global_reference *ref)

mutex_lock(&item->mutex);
if (item->refcount == 0) {
item->object = kmalloc(ref->size, GFP_KERNEL);
item->object = kzalloc(ref->size, GFP_KERNEL);
if (unlikely(item->object == NULL)) {
ret = -ENOMEM;
goto out_err;
Expand All @@ -89,7 +89,6 @@ int ttm_global_item_ref(struct ttm_global_reference *ref)
mutex_unlock(&item->mutex);
return 0;
out_err:
kfree(item->object);
mutex_unlock(&item->mutex);
item->object = NULL;
return ret;
Expand All @@ -105,7 +104,6 @@ void ttm_global_item_unref(struct ttm_global_reference *ref)
BUG_ON(ref->object != item->object);
if (--item->refcount == 0) {
ref->release(ref);
kfree(item->object);
item->object = NULL;
}
mutex_unlock(&item->mutex);
Expand Down
Loading

0 comments on commit 2296974

Please sign in to comment.