Re: [PATCH v2 2/3] coresight: tnoc: Fix fwnode reference leak on probe failure
From: James Clark
Date: Fri Nov 27 2026 - 06:18:58 EST
On 26/11/2026 15:57, Yige Jiang wrote:
_tnoc_probe() parses the output connections before allocating driver
data, enabling clocks, mapping registers and setting up the trace ID.
If any of these steps fails, probe returns before coresight_register()
can take ownership of the destination fwnode references.
Get the platform data after trace ID setup. On either lookup or
registration failure, return the ID if the AMBA device acquired one.
The platform-device variant does not allocate a trace ID.
Codex helped trace the two probe paths and draft their shared cleanup.
Fixes: e54a52a28a36 ("coresight: add coresight Trace Network On Chip driver")
Suggested-by: James Clark <james.clark@xxxxxxxxxx>
Signed-off-by: Yige Jiang <yigejiang86@xxxxxxxxx>
---
v2: Add the TNOC fix identified during review of the TPDM patch.
The threading is broken for the patchset. Check out the b4 tools, they handle patch creation and sending properly.