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

Skip to content
Commit a2d4f1e7 authored by Sharat Masetty's avatar Sharat Masetty
Browse files

devfreq: Fix possible race in tz_start() handler



The TZ governor start can be invoked through the sysfs governor store()
operation. This opens up a possible race when user space tries to set
the same governor operation twice  leading to calling the TZ governors
tz_handler() in succession. While the first one goes through
successfully and queues the work for starting the bandwidth governor,
before the work gets to run, the second invocation of the tz_handler
reinitializes the work. This causes the internal state of the work item
to be reset causing a crash in the kernel workqueue handler.

This patch tries to address this problem by not allowing the
tz_handler() to run the next time, if the first invocation was already
successful and potentially in progress.

Change-Id: Id2d6b9f680c873937a64eeb483ce8359306cd7b0
Signed-off-by: default avatarSharat Masetty <smasetty@codeaurora.org>
parent 3fda7c70
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