diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-01-31 11:03:53 +0100 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-01-31 11:03:53 +0100 |
commit | 36d50687dd88e0e42cf2adfd8ff81a160765e12a (patch) | |
tree | a66a9f9730566387a5e0c1dc72888937bfb30a0f /linux-core | |
parent | d399fcf46f3b9eab0eb37aefc8e593f8a711d1ef (diff) |
Fix an error-path oops.
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/drm_bo.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c index 7439e27d..2b960c75 100644 --- a/linux-core/drm_bo.c +++ b/linux-core/drm_bo.c @@ -373,11 +373,13 @@ static void drm_bo_base_deref_locked(drm_file_t * priv, drm_user_object_t * uo) static void drm_bo_usage_deref_unlocked(drm_buffer_object_t * bo) { + drm_device_t *dev = bo->dev; + if (atomic_dec_and_test(&bo->usage)) { - mutex_lock(&bo->dev->struct_mutex); + mutex_lock(&dev->struct_mutex); if (atomic_read(&bo->usage) == 0) drm_bo_destroy_locked(bo); - mutex_unlock(&bo->dev->struct_mutex); + mutex_unlock(&dev->struct_mutex); } } |