diff options
author | Dave Airlie <airlied@redhat.com> | 2010-04-29 18:37:59 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-18 18:21:37 +1000 |
commit | f4b7fb94c576265ceffc43031805ade32fa80c6a (patch) | |
tree | ac476c8284396186ab451df7d8a8bc4411b84f03 | |
parent | 539d24181753e40174746d576d415bfb56131975 (diff) | |
download | linux-3.10-f4b7fb94c576265ceffc43031805ade32fa80c6a.tar.gz linux-3.10-f4b7fb94c576265ceffc43031805ade32fa80c6a.tar.bz2 linux-3.10-f4b7fb94c576265ceffc43031805ade32fa80c6a.zip |
drm/radeon/kms: take vram mutex pointer before derefing object.
since derefing the object might free it.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_object.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 06def708b01..a8d18bcae7d 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -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; } |