提交 c87a8d8d 编写于 作者: D Dave Airlie

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: NDave Airlie <airlied@redhat.com>
上级 a3a88a66
...@@ -358,6 +358,7 @@ int radeon_mode_dumb_create(struct drm_file *file_priv, ...@@ -358,6 +358,7 @@ int radeon_mode_dumb_create(struct drm_file *file_priv,
{ {
struct radeon_device *rdev = dev->dev_private; struct radeon_device *rdev = dev->dev_private;
struct drm_gem_object *gobj; struct drm_gem_object *gobj;
uint32_t handle;
int r; int r;
args->pitch = radeon_align_pitch(rdev, args->width, args->bpp, 0) * ((args->bpp + 1) / 8); 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,12 +372,13 @@ int radeon_mode_dumb_create(struct drm_file *file_priv,
if (r) if (r)
return -ENOMEM; return -ENOMEM;
r = drm_gem_handle_create(file_priv, gobj, &args->handle); r = drm_gem_handle_create(file_priv, gobj, &handle);
if (r) { /* drop reference from allocate - handle holds it now */
drm_gem_object_unreference_unlocked(gobj); drm_gem_object_unreference_unlocked(gobj);
if (r) {
return r; return r;
} }
drm_gem_object_handle_unreference_unlocked(gobj); args->handle = handle;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册