Re: [PATCH] video: of_display_timing: fix refcount leak in of_get_display_timings()
From: Helge Deller
Date: Tue Jan 27 2026 - 12:33:02 EST
On 1/16/26 10:57, Weigang He wrote:
of_parse_phandle() returns a device_node with refcount incremented,
which is stored in 'entry' and then copied to 'native_mode'. When the
error paths at lines 184 or 192 jump to 'entryfail', native_mode's
refcount is not decremented, causing a refcount leak.
Fix this by changing the goto target from 'entryfail' to 'timingfail',
which properly calls of_node_put(native_mode) before cleanup.
Fixes: cc3f414cf2e4 ("video: add of helper for display timings/videomode")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Weigang He <geoffreyhe2@xxxxxxxxx>
---
drivers/video/of_display_timing.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
applied.
Thanks!
Helge