diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2010-11-09 21:31:44 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-11-10 11:52:19 +1000 |
commit | 7dfbbdcffebc41441e64278961f57d2840a76259 (patch) | |
tree | 5a536fdc99de855160409a33f5049ebb503c66de /include | |
parent | 2b66b50b12cabc05f05543e792d4c9c2465d5702 (diff) | |
download | linux-stable-7dfbbdcffebc41441e64278961f57d2840a76259.tar.gz linux-stable-7dfbbdcffebc41441e64278961f57d2840a76259.tar.bz2 linux-stable-7dfbbdcffebc41441e64278961f57d2840a76259.zip |
drm/ttm: Be consistent on ttm_bo_init() failures
Call destroy() on _all_ ttm_bo_init() failures, and make sure that
behavior is documented in the function description.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/drm/ttm/ttm_bo_api.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 5afa5b52063e..beafc156a535 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -432,6 +432,10 @@ extern void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo); * together with the @destroy function, * enables driver-specific objects derived from a ttm_buffer_object. * On successful return, the object kref and list_kref are set to 1. + * If a failure occurs, the function will call the @destroy function, or + * kfree() if @destroy is NULL. Thus, after a failure, dereferencing @bo is + * illegal and will likely cause memory corruption. + * * Returns * -ENOMEM: Out of memory. * -EINVAL: Invalid placement flags. |