Re: [PATCH 2/6] perf cs-etm: Free partially created queues

From: James Clark

Date: Thu Oct 01 2026 - 06:46:52 EST




On 04/09/2026 18:12, Leo Yan wrote:
On Fri, Aug 21, 2026 at 10:50:30AM +0100, James Clark wrote:
cs_etm__create_decoders() can fail half way through and the
err_free_queues label won't free them. Call the full queue free function
here instead. If no decoders were created it's a nop.

[...]

@@ -3520,6 +3527,7 @@ static int cs_etm__create_queue_decoders(struct cs_etm_queue *etmq)
out_free_decoder:
cs_etm_decoder__free(etmq->decoder);
+ etmq->decoder = NULL;

cs_etm__free_queue() also calls cs_etm_decoder__free() but does not
clear etmq->decoder. Should we do the same there, or drop this
unrelated change?

Yep we should do the same, I'll make cs_etm_decoder__free() call zfree() and drop the explicit NULL.


Otherwise, for the queues free fix:

Reviewed-by: Leo Yan <leo.yan@xxxxxxx>