Skip to content

Commit

Permalink
Merge tag 'coresight-fixes-v6.4' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/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 <[email protected]>

* 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()
  • Loading branch information
gregkh committed May 13, 2023
2 parents ac9a786 + 04ac7f9 commit 000dcaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/hwtracing/coresight/coresight-etm-perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ static void *etm_setup_aux(struct perf_event *event, void **pages,
trace_id = coresight_trace_id_get_cpu_id(cpu);
if (!IS_VALID_CS_TRACE_ID(trace_id)) {
cpumask_clear_cpu(cpu, mask);
coresight_release_path(path);
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/hwtracing/coresight/coresight-tmc-etr.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ tmc_etr_buf_insert_barrier_packet(struct etr_buf *etr_buf, u64 offset)

len = tmc_etr_buf_get_data(etr_buf, offset,
CORESIGHT_BARRIER_PKT_SIZE, &bufp);
if (WARN_ON(len < CORESIGHT_BARRIER_PKT_SIZE))
if (WARN_ON(len < 0 || len < CORESIGHT_BARRIER_PKT_SIZE))
return -EINVAL;
coresight_insert_barrier_packet(bufp);
return offset + CORESIGHT_BARRIER_PKT_SIZE;
Expand Down

0 comments on commit 000dcaa

Please sign in to comment.