mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
msm: kgsl: Fix context leak in aux_command ioctl
Currently, after timeline drawobj creation it is not immediately added to local drawobj list as a result if kgsl_drawobj_add_timeline fails this drawobj is leaked. As the timeline drawobj upon creation takes a refcount on the context this leak also results in context leak. Fix this by adding timeline drawobj to local drawobj list immediately after creation. Change-Id: I30f85506595ad7a7c54e82a7e850c96e7cdcbefd Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org> Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
This commit is contained in:
parent
09f4de94dc
commit
8ed160d88b
2 changed files with 3 additions and 2 deletions
|
|
@ -2023,12 +2023,12 @@ long kgsl_ioctl_gpu_aux_command(struct kgsl_device_private *dev_priv,
|
|||
goto err;
|
||||
}
|
||||
|
||||
drawobjs[index++] = DRAWOBJ(timelineobj);
|
||||
|
||||
ret = kgsl_drawobj_add_timeline(dev_priv, timelineobj,
|
||||
u64_to_user_ptr(generic.priv), generic.size);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
drawobjs[index++] = DRAWOBJ(timelineobj);
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
|
|
|
|||
|
|
@ -900,6 +900,7 @@ err:
|
|||
kgsl_timeline_put(timelineobj->timelines[i].timeline);
|
||||
|
||||
kvfree(timelineobj->timelines);
|
||||
timelineobj->timelines = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue