Commit 2be7e240 authored by James Clark's avatar James Clark Committed by Greg Kroah-Hartman
Browse files

coresight: Fix ref leak when of_coresight_parse_endpoint() fails



[ Upstream commit 7fcb9cb2 ]

of_graph_get_next_endpoint() releases the reference to the previous
endpoint on each iteration, but when parsing fails the loop exits
early meaning the last reference is never dropped.

Fix it by dropping the refcount in the exit condition.

Fixes: d375b356 ("coresight: Fix support for sparsely populated ports")
Signed-off-by: default avatarJames Clark <james.clark@arm.com>
Reported-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20240529133626.90080-1-james.clark@arm.com


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