msm: kgsl: Keep private intact until last refcount is put
Currently, we are partially freeing private once last file is
closed but closing last file doesn't necessarily means that
all refcount on private is also put. This results in having a
partially initialized private struct which is not yet freed
and also can't be re-used. As a result if an application is
just opening and closing kgsl device in a loop we will end up
allocating and initializing a new private every time. This also
allows application to mis-use this and create more than allowed
limit of 200 contexts as they can use newly created private to
create new context every time.
To fix this, keep private intact until last refcount is put.
This ensures we can re-use same private if same pid is doing
kgsl open and close repeatedly and also ensures that an app
can't breach 200 context limit.
Change-Id: Ia1d1071275c7691a3d50bc15477b71387c5806d6
Signed-off-by:
Deepak Kumar <dkumar@codeaurora.org>
Loading
Please register or sign in to comment