Skip to content

Commit

Permalink
drm/radeon: fixup refcounts in radeon dumb create ioctl.
Browse files Browse the repository at this point in the history
This was using old gem refcounting methods, fix it to be the same
as the normal create ioctl.

Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Dave Airlie committed Mar 17, 2011
1 parent a3a88a6 commit c87a8d8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/gpu/drm/radeon/radeon_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ int radeon_mode_dumb_create(struct drm_file *file_priv,
{
struct radeon_device *rdev = dev->dev_private;
struct drm_gem_object *gobj;
uint32_t handle;
int r;

args->pitch = radeon_align_pitch(rdev, args->width, args->bpp, 0) * ((args->bpp + 1) / 8);
Expand All @@ -371,12 +372,13 @@ int radeon_mode_dumb_create(struct drm_file *file_priv,
if (r)
return -ENOMEM;

r = drm_gem_handle_create(file_priv, gobj, &args->handle);
r = drm_gem_handle_create(file_priv, gobj, &handle);
/* drop reference from allocate - handle holds it now */
drm_gem_object_unreference_unlocked(gobj);
if (r) {
drm_gem_object_unreference_unlocked(gobj);
return r;
}
drm_gem_object_handle_unreference_unlocked(gobj);
args->handle = handle;
return 0;
}

Expand Down

0 comments on commit c87a8d8

Please sign in to comment.