msm: kgsl: Fix race between timeline create/others and destroy ioctls
When creating a timeline allocate an ID but don't populate the slot
with the timeline pointer until we are done initializing the timeline.
This avoids a race if somebody tries to free the same identifier before
the create operation is complete. Also, correct kgsl_timeline_by_id
function by doing idr_find and refcount increase under same lock. This
eliminates the chance that a timeline will be destroyed while somebody
is still using it.
Change-Id: Id894baac1bbd6042f668ea4afca39fae3b5a2d86
Signed-off-by:
Deepak Kumar <dkumar@codeaurora.org>
Loading
Please register or sign in to comment