]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
coresight: etm: perf: Fix warning caused by etm_setup_aux failure
authorTingwei Zhang <tingwei@codeaurora.org>
Mon, 28 Sep 2020 16:34:56 +0000 (10:34 -0600)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:48:51 +0000 (14:48 +0100)
BugLink: https://bugs.launchpad.net/bugs/1902115
[ Upstream commit 716f5652a13122364a65e694386b9b26f5e98c51 ]

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: f5200aa9831f38 ("coresight: perf: Refactor function free_event_data()")
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Tingwei Zhang <tingwei@codeaurora.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200928163513.70169-9-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
drivers/hwtracing/coresight/coresight-etm-perf.c

index c4b9898e2841865486889676d8444fa9e4ad5ead..9b0c5d719232f23c293a64cf5e8b860f08380368 100644 (file)
@@ -126,10 +126,10 @@ static void free_sink_buffer(struct etm_event_data *event_data)
        cpumask_t *mask = &event_data->mask;
        struct coresight_device *sink;
 
-       if (WARN_ON(cpumask_empty(mask)))
+       if (!event_data->snk_config)
                return;
 
-       if (!event_data->snk_config)
+       if (WARN_ON(cpumask_empty(mask)))
                return;
 
        cpu = cpumask_first(mask);