diff options
| author | Yeoreum Yun <yeoreum.yun@arm.com> | 2026-07-25 12:36:35 +0100 |
|---|---|---|
| committer | Suzuki K Poulose <suzuki.poulose@arm.com> | 2026-08-07 10:45:11 +0100 |
| commit | 467e5862ccb0eed907002f4c6d3badfe34360940 (patch) | |
| tree | 1c2662373af16968c52a7b0e77e8ce65894e8473 | |
| parent | 1674d9bff8073bdee5dbc200f56fc3caa28d0566 (diff) | |
| download | linux-stable-467e5862ccb0eed907002f4c6d3badfe34360940.tar.gz linux-stable-467e5862ccb0eed907002f4c6d3badfe34360940.zip | |
coresight: etm4x: fix leaked trace id
If etm4_enable_sysfs() fails in cscfg_csdev_enable_active_config(),
the trace ID may be leaked because it is not released.
To address this, call etm4_release_trace_id() when etm4_enable_sysfs()
fails in cscfg_csdev_enable_active_config().
Fixes: 7ebd0ec6cf94 ("coresight: configfs: Allow configfs to activate configuration")
Reviewed-by: Jie Gan <jie.gan@oss.qualcomm.com>
Reviewed-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20260725113645.57519-4-yeoreum.yun@arm.com
| -rw-r--r-- | drivers/hwtracing/coresight/coresight-etm4x-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index 1884960cfe6f..8363c55b3952 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -920,8 +920,10 @@ static int etm4_enable_sysfs(struct coresight_device *csdev, struct coresight_pa cscfg_config_sysfs_get_active_cfg(&cfg_hash, &preset); if (cfg_hash) { ret = cscfg_csdev_enable_active_config(csdev, cfg_hash, preset); - if (ret) + if (ret) { + etm4_release_trace_id(drvdata); return ret; + } } raw_spin_lock(&drvdata->spinlock); |
