aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_gem.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-12-15 22:10:43 -0500
committerDave Airlie <airlied@redhat.com>2009-12-16 00:38:56 -0500
commit51f07b7ebce15c1848743a2ba43a0005375d8243 (patch)
treeb5efb0388671c82bfa549fc2c29cd31a22217b03 /drivers/gpu/drm/radeon/radeon_gem.c
parentecabd32a623eaf3e4c853ff73f200c8079028000 (diff)
drm/radeon/gem: don't leak a gem object if reserve fails on get tiling (v2)
Not sure it ever happens in practice, spotted during code review. spare brace snuck in Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_gem.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_gem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index ee827cc22afe..60df2d7e7e4c 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -351,9 +351,10 @@ int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data,
351 rbo = gobj->driver_private; 351 rbo = gobj->driver_private;
352 r = radeon_bo_reserve(rbo, false); 352 r = radeon_bo_reserve(rbo, false);
353 if (unlikely(r != 0)) 353 if (unlikely(r != 0))
354 return r; 354 goto out;
355 radeon_bo_get_tiling_flags(rbo, &args->tiling_flags, &args->pitch); 355 radeon_bo_get_tiling_flags(rbo, &args->tiling_flags, &args->pitch);
356 radeon_bo_unreserve(rbo); 356 radeon_bo_unreserve(rbo);
357out:
357 mutex_lock(&dev->struct_mutex); 358 mutex_lock(&dev->struct_mutex);
358 drm_gem_object_unreference(gobj); 359 drm_gem_object_unreference(gobj);
359 mutex_unlock(&dev->struct_mutex); 360 mutex_unlock(&dev->struct_mutex);