Skip to content

Commit b23789a

Browse files
Yuuoniyhdeller
authored andcommitted
video: fbdev: clcdfb: Fix refcount leak in clcdfb_of_vram_setup
of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: d10715b ("video: ARM CLCD: Add DT support") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent c4b4d70 commit b23789a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/video/fbdev/amba-clcd.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,15 @@ static int clcdfb_of_vram_setup(struct clcd_fb *fb)
758758
return -ENODEV;
759759

760760
fb->fb.screen_base = of_iomap(memory, 0);
761-
if (!fb->fb.screen_base)
761+
if (!fb->fb.screen_base) {
762+
of_node_put(memory);
762763
return -ENOMEM;
764+
}
763765

764766
fb->fb.fix.smem_start = of_translate_address(memory,
765767
of_get_address(memory, 0, &size, NULL));
766768
fb->fb.fix.smem_len = size;
769+
of_node_put(memory);
767770

768771
return 0;
769772
}

0 commit comments

Comments
 (0)