summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/sched-migration.py
diff options
context:
space:
mode:
authorMa Ke <make24@iscas.ac.cn>2025-08-12 15:19:32 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-04 15:31:55 +0200
commit31ce7c089b50c3d3056c37e0e25e7535e4428ae1 (patch)
tree4171a75200f2c21a930af02684e3c6254437df28 /tools/perf/scripts/python/sched-migration.py
parentc5e42567724ee99d45e1eb98bb4b9c04e2294d26 (diff)
drm/mediatek: Fix device/node reference count leaks in mtk_drm_get_all_drm_priv
commit 1f403699c40f0806a707a9a6eed3b8904224021a upstream. Using device_find_child() and of_find_device_by_node() to locate devices could cause an imbalance in the device's reference count. device_find_child() and of_find_device_by_node() both call get_device() to increment the reference count of the found device before returning the pointer. In mtk_drm_get_all_drm_priv(), these references are never released through put_device(), resulting in permanent reference count increments. Additionally, the for_each_child_of_node() iterator fails to release node references in all code paths. This leaks device node references when loop termination occurs before reaching MAX_CRTC. These reference count leaks may prevent device/node resources from being properly released during driver unbind operations. As comment of device_find_child() says, 'NOTE: you will need to drop the reference with put_device() after use'. Cc: stable@vger.kernel.org Fixes: 1ef7ed48356c ("drm/mediatek: Modify mediatek-drm for mt8195 multi mmsys support") Signed-off-by: Ma Ke <make24@iscas.ac.cn> Reviewed-by: CK Hu <ck.hu@mediatek.com> Link: https://patchwork.kernel.org/project/dri-devel/patch/20250812071932.471730-1-make24@iscas.ac.cn/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions