diff options
author | Dave Airlie <airlied@redhat.com> | 2011-03-16 23:58:34 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-03-16 23:58:34 -0400 |
commit | c87a8d8dcd2587c203f3dd8a3c5c15d1e128ec0d (patch) | |
tree | 46a860489285c11834ec1241cb2c95b95d60c5d4 /drivers/gpu | |
parent | a3a88a668ffe8f9771a525a2b00570f8a4c29286 (diff) |
drm/radeon: fixup refcounts in radeon dumb create ioctl.
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_gem.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index 723cd19cd22f..aa1ca2dea42f 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c | |||
@@ -358,6 +358,7 @@ int radeon_mode_dumb_create(struct drm_file *file_priv, | |||
358 | { | 358 | { |
359 | struct radeon_device *rdev = dev->dev_private; | 359 | struct radeon_device *rdev = dev->dev_private; |
360 | struct drm_gem_object *gobj; | 360 | struct drm_gem_object *gobj; |
361 | uint32_t handle; | ||
361 | int r; | 362 | int r; |
362 | 363 | ||
363 | args->pitch = radeon_align_pitch(rdev, args->width, args->bpp, 0) * ((args->bpp + 1) / 8); | 364 | args->pitch = radeon_align_pitch(rdev, args->width, args->bpp, 0) * ((args->bpp + 1) / 8); |
@@ -371,12 +372,13 @@ int radeon_mode_dumb_create(struct drm_file *file_priv, | |||
371 | if (r) | 372 | if (r) |
372 | return -ENOMEM; | 373 | return -ENOMEM; |
373 | 374 | ||
374 | r = drm_gem_handle_create(file_priv, gobj, &args->handle); | 375 | r = drm_gem_handle_create(file_priv, gobj, &handle); |
376 | /* drop reference from allocate - handle holds it now */ | ||
377 | drm_gem_object_unreference_unlocked(gobj); | ||
375 | if (r) { | 378 | if (r) { |
376 | drm_gem_object_unreference_unlocked(gobj); | ||
377 | return r; | 379 | return r; |
378 | } | 380 | } |
379 | drm_gem_object_handle_unreference_unlocked(gobj); | 381 | args->handle = handle; |
380 | return 0; | 382 | return 0; |
381 | } | 383 | } |
382 | 384 | ||