Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310671
b: refs/heads/master
c: a393c73
h: refs/heads/master
i:
  310669: 38fd70b
  310667: d06f395
  310663: a516a14
  310655: 7d3a195
v: v3
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Jun 12, 2012
1 parent dd8315c commit ed87f2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 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: fe4561680519019cc15d660862dce513ded2f3a7
refs/heads/master: a393c730ab69617c3291a3b0b2a228c9be2fc28c
13 changes: 3 additions & 10 deletions trunk/drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
(*destroy)(bo);
else
kfree(bo);
ttm_mem_global_free(mem_glob, acc_size);
return -EINVAL;
}
bo->destroy = destroy;
Expand Down Expand Up @@ -1307,22 +1308,14 @@ int ttm_bo_create(struct ttm_bo_device *bdev,
struct ttm_buffer_object **p_bo)
{
struct ttm_buffer_object *bo;
struct ttm_mem_global *mem_glob = bdev->glob->mem_glob;
size_t acc_size;
int ret;

acc_size = ttm_bo_acc_size(bdev, size, sizeof(struct ttm_buffer_object));
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);
if (unlikely(bo == NULL))
return -ENOMEM;
}

acc_size = ttm_bo_acc_size(bdev, size, sizeof(struct ttm_buffer_object));
ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment,
buffer_start, interruptible,
persistent_swap_storage, acc_size, NULL, NULL);
Expand Down

0 comments on commit ed87f2b

Please sign in to comment.