]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
interconnect: Treat xlate() returning NULL node as an error
authorMike Tipton <quic_mdtipton@quicinc.com>
Wed, 25 Oct 2023 14:58:29 +0000 (07:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jan 2024 14:12:26 +0000 (15:12 +0100)
commit505df1c0abe6ed90e9d6920f44b3c5374effbf71
treeea332431158d3af29a96767bc32ef076eba77873
parentcc5eec86a4ffeaeb7ed88c291d59eac359d30437
interconnect: Treat xlate() returning NULL node as an error

[ Upstream commit ad2ab1297d0c80899125a842bb7a078abfe1e6ce ]

Currently, if provider->xlate() or provider->xlate_extended()
"successfully" return a NULL node, then of_icc_get_from_provider() won't
consider that an error and will successfully return the NULL node. This
bypasses error handling in of_icc_get_by_index() and leads to NULL
dereferences in path_find().

This could be avoided by ensuring provider callbacks always return an
error for NULL nodes, but it's better to explicitly protect against this
in the common framework.

Fixes: 87e3031b6fbd ("interconnect: Allow endpoints translation via DT")
Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
Link: https://lore.kernel.org/r/20231025145829.11603-1-quic_mdtipton@quicinc.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/interconnect/core.c