Skip to content

Commit

Permalink
Revert "drm/i915: Unreference object not handle on creation"
Browse files Browse the repository at this point in the history
This reverts commit 86f100b.

The kref API requires the handlecount to be initialised to one on object
creation (so that kref_get() doesn't complain upon first use) so the
dalliance in the drivers is required in order to sink the initial
floating reference.

Signed-off-by: Chris Wilson <[email protected]>
Cc: [email protected]
  • Loading branch information
ickle committed Sep 6, 2010
1 parent e167976 commit 1dfd975
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,15 @@ i915_gem_create_ioctl(struct drm_device *dev, void *data,
return -ENOMEM;

ret = drm_gem_handle_create(file_priv, obj, &handle);
drm_gem_object_unreference_unlocked(obj);
if (ret)
if (ret) {
drm_gem_object_unreference_unlocked(obj);
return ret;
}

args->handle = handle;
/* Sink the floating reference from kref_init(handlecount) */
drm_gem_object_handle_unreference_unlocked(obj);

args->handle = handle;
return 0;
}

Expand Down

0 comments on commit 1dfd975

Please sign in to comment.