mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-01-03 22:10:17 +01:00
Fix an error-path oops.
This commit is contained in:
parent
d399fcf46f
commit
36d50687dd
1 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue