Commit 716f5652 authored by Tingwei Zhang's avatar Tingwei Zhang Committed by Greg Kroah-Hartman

coresight: etm: perf: Fix warning caused by etm_setup_aux failure

When coresight_build_path() fails on all the cpus, etm_setup_aux
calls etm_free_aux() to free allocated event_data.
WARN_ON(cpumask_empty(mask) will be triggered since cpu mask is empty.
Check event_data->snk_config is not NULL first to avoid this
warning.

Fixes: f5200aa9 ("coresight: perf: Refactor function free_event_data()")
Reviewed-by: default avatarMike Leach <mike.leach@linaro.org>
Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: default avatarTingwei Zhang <tingwei@codeaurora.org>
Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200928163513.70169-9-mathieu.poirier@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8b0cf826
...@@ -126,10 +126,10 @@ static void free_sink_buffer(struct etm_event_data *event_data) ...@@ -126,10 +126,10 @@ static void free_sink_buffer(struct etm_event_data *event_data)
cpumask_t *mask = &event_data->mask; cpumask_t *mask = &event_data->mask;
struct coresight_device *sink; struct coresight_device *sink;
if (WARN_ON(cpumask_empty(mask))) if (!event_data->snk_config)
return; return;
if (!event_data->snk_config) if (WARN_ON(cpumask_empty(mask)))
return; return;
cpu = cpumask_first(mask); cpu = cpumask_first(mask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment