Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1dfd9754 authored by Chris Wilson's avatar Chris Wilson
Browse files

Revert "drm/i915: Unreference object not handle on creation"



This reverts commit 86f100b1.

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
parent e167976e
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -135,12 +135,15 @@ i915_gem_create_ioctl(struct drm_device *dev, void *data,
		return -ENOMEM;
		return -ENOMEM;


	ret = drm_gem_handle_create(file_priv, obj, &handle);
	ret = drm_gem_handle_create(file_priv, obj, &handle);
	if (ret) {
		drm_gem_object_unreference_unlocked(obj);
		drm_gem_object_unreference_unlocked(obj);
	if (ret)
		return ret;
		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;
	return 0;
}
}