summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorStepan Ionichev <sozdayvek@gmail.com>2026-05-14 20:14:55 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-05-22 14:33:09 +0300
commit9582485a65eacfd7245ec7f0a9d7e2c34749d669 (patch)
tree4c29b1238d2eec48193792f4fb74d7068718dafc /include/linux
parenta9c12b783cc711de3ac7f188bed07d529bb818af (diff)
downloadlinux-9582485a65eacfd7245ec7f0a9d7e2c34749d669.tar.xz
device property: fix fwnode reference leak in fwnode_graph_get_endpoint_by_id()
When called with FWNODE_GRAPH_ENDPOINT_NEXT, the function walks every endpoint under the requested port and, for any endpoint whose ID is greater than or equal to the requested one, may store a fwnode reference in best_ep via fwnode_handle_get(). If a later iteration finds an exact-ID match, the function returns that endpoint directly without dropping the reference held by best_ep, leaking it. Drop the saved candidate before returning the exact-match endpoint. This affects callers that use FWNODE_GRAPH_ENDPOINT_NEXT to ask for the next endpoint with ID >= the requested one (used by a number of media drivers, e.g. imx7/8, sun6i CSI, omap3isp, xilinx-csi2, stm32-csi). Each leak retains a fwnode reference until reboot/unbind. Fixes: 0fcc2bdc8aff ("device property: Add fwnode_graph_get_endpoint_by_id()") Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> Link: https://patch.msgid.link/20260514171455.27271-1-sozdayvek@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions