git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
drm/ttm: Be consistent on ttm_bo_init() failures
[pandora-kernel.git]
/
drivers
/
gpu
/
drm
/
ttm
/
ttm_bo.c
diff --git
a/drivers/gpu/drm/ttm/ttm_bo.c
b/drivers/gpu/drm/ttm/ttm_bo.c
index
ce46457
..
3ca77dc
100644
(file)
--- a/
drivers/gpu/drm/ttm/ttm_bo.c
+++ b/
drivers/gpu/drm/ttm/ttm_bo.c
@@
-1144,6
+1144,10
@@
int ttm_bo_init(struct ttm_bo_device *bdev,
num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
if (num_pages == 0) {
printk(KERN_ERR TTM_PFX "Illegal buffer object size.\n");
+ if (destroy)
+ (*destroy)(bo);
+ else
+ kfree(bo);
return -EINVAL;
}
bo->destroy = destroy;