diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-02-14 12:37:41 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-03-30 06:53:06 +0300 |
commit | 882e8cfcbc2157448976c9d37af4fc144949559f (patch) | |
tree | 7a93dc307404a5f6d0aa2d850623ee142e8b8a1b /include/drm | |
parent | b9d022c630fa77c7044ea21e2597245a91e69856 (diff) | |
download | linux-882e8cfcbc2157448976c9d37af4fc144949559f.tar.xz |
drm/ttm: fix the documentation of ttm_bo_init
As the comment says: callers of ttm_bo_init cannot rely on having the
only reference to the BO when the function returns successfully.
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/ttm/ttm_bo_api.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 8f619f499e55..de5f992de928 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -463,7 +463,11 @@ size_t ttm_bo_dma_acc_size(struct ttm_bo_device *bdev, * As this object may be part of a larger structure, this function, * 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. + * + * On successful return, the caller owns an object kref to @bo. The kref and + * list_kref are usually set to 1, but note that in some situations, other + * tasks may already be holding references to @bo as well. + * * 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. |