Commit 296da784 authored by Leo Yan's avatar Leo Yan Committed by Greg Kroah-Hartman
Browse files

coresight: trbe: Return NULL pointer for allocation failures



[ Upstream commit 8a55c161 ]

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: 3fbf7f01 ("coresight: sink: Add TRBE driver")
Reported-by: default avatarTamas Zsoldos <tamas.zsoldos@arm.com>
Signed-off-by: default avatarLeo Yan <leo.yan@arm.com>
Reviewed-by: default avatarJames Clark <james.clark@linaro.org>
Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20250904-cs_etm_auxsetup_fix_error_handling-v2-1-a502d0bafb95@arm.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent e7c19569
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment