提交 f4b7fb94 编写于 作者: D Dave Airlie

drm/radeon/kms: take vram mutex pointer before derefing object.

since derefing the object might free it.
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 539d2418
......@@ -168,13 +168,15 @@ void radeon_bo_kunmap(struct radeon_bo *bo)
void radeon_bo_unref(struct radeon_bo **bo)
{
struct ttm_buffer_object *tbo;
struct radeon_device *rdev;
if ((*bo) == NULL)
return;
rdev = (*bo)->rdev;
tbo = &((*bo)->tbo);
mutex_lock(&(*bo)->rdev->vram_mutex);
mutex_lock(&rdev->vram_mutex);
ttm_bo_unref(&tbo);
mutex_unlock(&(*bo)->rdev->vram_mutex);
mutex_unlock(&rdev->vram_mutex);
if (tbo == NULL)
*bo = NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册