mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
coresight: Forbid enabling sink while reading sink
Forbid enabling sink in the process of reading sink. Otherwise, sink flag "activated" will be set to true, and the source has a chance to be added to "cs_active_paths" twice. Then, system will crash if sink is continued to be read due to two same source in "cs_active_paths". Change-Id: I3317ea435e9d84258e3fcbf854a6078afcd4a08e Signed-off-by: Tao,Zhang <taozha@codeaurora.org>
This commit is contained in:
parent
063759141a
commit
b20c61948d
1 changed files with 1 additions and 5 deletions
|
|
@ -1151,7 +1151,6 @@ static ssize_t enable_sink_store(struct device *dev,
|
|||
int ret;
|
||||
unsigned long val;
|
||||
struct coresight_device *csdev = to_coresight_device(dev);
|
||||
struct coresight_device *sink = NULL;
|
||||
|
||||
ret = kstrtoul(buf, 10, &val);
|
||||
if (ret)
|
||||
|
|
@ -1159,10 +1158,7 @@ static ssize_t enable_sink_store(struct device *dev,
|
|||
mutex_lock(&coresight_mutex);
|
||||
|
||||
if (val) {
|
||||
sink = activated_sink ? activated_sink :
|
||||
coresight_get_enabled_sink(false);
|
||||
if (sink && strcmp(dev_name(&sink->dev),
|
||||
dev_name(&csdev->dev)))
|
||||
if (activated_sink)
|
||||
goto err;
|
||||
csdev->activated = true;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue