diff options
author | Miaoqian Lin <linmq006@gmail.com> | 2022-05-12 15:59:08 +0400 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2022-05-19 11:11:20 +0200 |
commit | b23789a59fa6f00e98a319291819f91fbba0deb8 (patch) | |
tree | 4ad4e5a2f24f89e0787cf7959a101df26dd3d78f /drivers/video/fbdev | |
parent | c4b4d7047f16a8d138ce76da65faefb7165736f2 (diff) | |
download | lwn-b23789a59fa6f00e98a319291819f91fbba0deb8.tar.gz lwn-b23789a59fa6f00e98a319291819f91fbba0deb8.zip |
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: d10715be03bd ("video: ARM CLCD: Add DT support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r-- | drivers/video/fbdev/amba-clcd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c index 9ec969e136bf..8080116aea84 100644 --- a/drivers/video/fbdev/amba-clcd.c +++ b/drivers/video/fbdev/amba-clcd.c @@ -758,12 +758,15 @@ static int clcdfb_of_vram_setup(struct clcd_fb *fb) return -ENODEV; fb->fb.screen_base = of_iomap(memory, 0); - if (!fb->fb.screen_base) + if (!fb->fb.screen_base) { + of_node_put(memory); return -ENOMEM; + } fb->fb.fix.smem_start = of_translate_address(memory, of_get_address(memory, 0, &size, NULL)); fb->fb.fix.smem_len = size; + of_node_put(memory); return 0; } |