drm/radeon/gem: don't leak a gem object if reserve fails on get tiling (v2)
authorDave Airlie <airlied@redhat.com>
Wed, 16 Dec 2009 03:10:43 +0000 (13:10 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 16 Dec 2009 05:38:56 +0000 (15:38 +1000)
Not sure it ever happens in practice, spotted during code review.

spare brace snuck in

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_gem.c

index ee827cc22afe7dba61fa640b01f2ff04fe80b427..60df2d7e7e4c9dd2572bee249978286ac109a549 100644 (file)
@@ -351,9 +351,10 @@ int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data,
        rbo = gobj->driver_private;
        r = radeon_bo_reserve(rbo, false);
        if (unlikely(r != 0))
-               return r;
+               goto out;
        radeon_bo_get_tiling_flags(rbo, &args->tiling_flags, &args->pitch);
        radeon_bo_unreserve(rbo);
+out:
        mutex_lock(&dev->struct_mutex);
        drm_gem_object_unreference(gobj);
        mutex_unlock(&dev->struct_mutex);