msm: vidc: Handle max clients error from video hardware

Use instance "lock" instead of "sync_lock" variable for
mutex lock/unlock for video instance state change operation
else session init will be timed out due to dead lock when
max clients error is received from video hardware because
"sync_lock" is already acquired before session init.
At the same time do not free the session when any error
is received from video hardware, if freed results in
dangling pointer access when video driver wants to send
any commands to video hardware after session error,
leading to device reset. The proper way of session cleanup
is already being done upon receiving any errors from
video hardware.

CRs-Fixed: 762541
Change-Id: I689dd255681826508069fa86fb5a87f92fc775b5
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Balamurugan Alagarsamy <balaga@codeaurora.org>
2 files changed