mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-28 06:44:36 -05:00
fbdev: valkyriefb: Fix reference count leak in valkyriefb_init
The of_find_node_by_name() function returns a device tree node with its
reference count incremented. The caller is responsible for calling
of_node_put() to release this reference when done.
Found via static analysis.
Fixes: cc5d0189b9 ("[PATCH] powerpc: Remove device_node addrs/n_addr")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
committed by
Helge Deller
parent
18cd0a9c7a
commit
eb53368f8d
@@ -329,11 +329,13 @@ static int __init valkyriefb_init(void)
|
||||
|
||||
if (of_address_to_resource(dp, 0, &r)) {
|
||||
printk(KERN_ERR "can't find address for valkyrie\n");
|
||||
of_node_put(dp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
frame_buffer_phys = r.start;
|
||||
cmap_regs_phys = r.start + 0x304000;
|
||||
of_node_put(dp);
|
||||
}
|
||||
#endif /* ppc (!CONFIG_MAC) */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user