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:Sharat Masetty <smasetty@codeaurora.org> Signed-off-by:
Deepak Kumar <dkumar@codeaurora.org>
Loading
Please sign in to comment