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

Commit f63967fe authored by Arun Menon's avatar Arun Menon Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Fix a race condition during session init



msm_comm_session_init calls hfi session_init function, which allocates
session memory, sends session_init command to firmware and returns
the session pointer. This gets stored in inst->session. When firmware
returns the session_init_done, in the callback function, we process
the message only if inst->session is valid.
Consider the case of forward thread being scheduled out after sending
session_init command to firmware, but before storing session pointer
in inst->session. In the mean time firmware has returned session_init_done,
which is received by driver, but we reject the message saying invalid
session, since inst->session is still NULL. This will cause driver to
time out waiting on session_init_done and fail the session.
This change ensures that the above race condition is avoided.

Change-Id: Ib0e916dd036ba42cb03602be9ef77e49fdcd8193
Signed-off-by: default avatarArun Menon <avmenon@codeaurora.org>
parent dec3acb0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment