Skip to content

Commit 000dcaa

Browse files
committed
Merge tag 'coresight-fixes-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-linus
Suzuki writes: coresight: Fixes for v6.4 Couple of fixes for coresight self-hosted tracing subsystem for v6.4. These include : - Fix signedness bug in tmc_etr_buf_insert_barrier_packet() - Fix memory leak with failing to release the path if trace-id allocation fails Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> * tag 'coresight-fixes-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux: coresight: perf: Release Coresight path when alloc trace id failed coresight: Fix signedness bug in tmc_etr_buf_insert_barrier_packet()
2 parents ac9a786 + 04ac7f9 commit 000dcaa

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

drivers/hwtracing/coresight/coresight-etm-perf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ static void *etm_setup_aux(struct perf_event *event, void **pages,
402402
trace_id = coresight_trace_id_get_cpu_id(cpu);
403403
if (!IS_VALID_CS_TRACE_ID(trace_id)) {
404404
cpumask_clear_cpu(cpu, mask);
405+
coresight_release_path(path);
405406
continue;
406407
}
407408

drivers/hwtracing/coresight/coresight-tmc-etr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ tmc_etr_buf_insert_barrier_packet(struct etr_buf *etr_buf, u64 offset)
942942

943943
len = tmc_etr_buf_get_data(etr_buf, offset,
944944
CORESIGHT_BARRIER_PKT_SIZE, &bufp);
945-
if (WARN_ON(len < CORESIGHT_BARRIER_PKT_SIZE))
945+
if (WARN_ON(len < 0 || len < CORESIGHT_BARRIER_PKT_SIZE))
946946
return -EINVAL;
947947
coresight_insert_barrier_packet(bufp);
948948
return offset + CORESIGHT_BARRIER_PKT_SIZE;

0 commit comments

Comments
 (0)