diff options
author | Leo Yan <leo.yan@arm.com> | 2025-09-04 15:13:52 +0100 |
---|---|---|
committer | Suzuki K Poulose <suzuki.poulose@arm.com> | 2025-09-23 14:14:13 +0100 |
commit | 8a55c161f7f9c1aa1c70611b39830d51c83ef36d (patch) | |
tree | 1ee91cd033d3a23554f05c610c53c79271404ae4 /rust/helpers/atomic.c | |
parent | dc783892cca69e721f81d54293dac6286134abfe (diff) |
coresight: trbe: Return NULL pointer for allocation failures
When the TRBE driver fails to allocate a buffer, it currently returns
the error code "-ENOMEM". However, the caller etm_setup_aux() only
checks for a NULL pointer, so it misses the error. As a result, the
driver continues and eventually causes a kernel panic.
Fix this by returning a NULL pointer from arm_trbe_alloc_buffer() on
allocation failures. This allows that the callers can properly handle
the failure.
Fixes: 3fbf7f011f24 ("coresight: sink: Add TRBE driver")
Reported-by: Tamas Zsoldos <tamas.zsoldos@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20250904-cs_etm_auxsetup_fix_error_handling-v2-1-a502d0bafb95@arm.com
Diffstat (limited to 'rust/helpers/atomic.c')
0 files changed, 0 insertions, 0 deletions