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

Skip to content
Commit 270bef8e authored by Arun Menon's avatar Arun Menon
Browse files

msm: vidc: avoid re-initialize of v4l2 spin lock



The fh_lock and fh_list variables are initialized
during probe in video_register_device. This was
re-initialized again when a new video instance was
opened. Since all video instances shared the same
fh_lock and fh_list variable, this gave rise to a race
condition in the v4l2 video driver. Consider the
case of multiple video instances being opened simultaneously.
One video instance has acquired the fh_lock and
calls a v4l2 function which calls v4l2_event_subscribe.
During this time another video instance is opened
and it re-intializes the fh_lock, so the first
instance no longer holds the spin lock and hits
ASSERT in v4l2_event_subscribed. This change
fixes the race condition.

Change-Id: I7af98c8f091cb94e6118c9e2ea1ba5d5d44c6833
Signed-off-by: default avatarArun Menon <avmenon@codeaurora.org>
parent 4a2fbc17
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