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

Commit a59008b3 authored by Prakash Kamliya's avatar Prakash Kamliya
Browse files

msm: kgsl: Fix creating invalid context when process private get fails



kgsl_context_init() returns 0 (success) even if getting
reference to process private fails, with this we will end up
creating an invalid context. Return error when process
refcounting fails to avoid creating invalid context.

Change-Id: Iad6a55c48f42c435027013615fab675238247be8
Signed-off-by: default avatarPrakash Kamliya <pkamliya@codeaurora.org>
parent 5a786dbc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -575,8 +575,10 @@ int kgsl_context_init(struct kgsl_device_private *dev_priv,
	 * the context is destroyed. This will also prevent the pagetable
	 * from being destroyed
	 */
	if (!kgsl_process_private_get(dev_priv->process_priv))
	if (!kgsl_process_private_get(dev_priv->process_priv)) {
		ret = -EBADF;
		goto fail_free_id;
	}
	context->device = dev_priv->device;
	context->dev_priv = dev_priv;
	context->proc_priv = dev_priv->process_priv;