]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/ttm: fix the documentation of ttm_bo_init
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 14 Feb 2017 09:37:41 +0000 (10:37 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Mar 2017 03:53:06 +0000 (23:53 -0400)
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>
include/drm/ttm/ttm_bo_api.h

index 8f619f499e5506f04249f0511ea9e158d1634adb..de5f992de9284966e79420cc696941accfbe643d 100644 (file)
@@ -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.