Skip to content

Commit eb53368

Browse files
Yuuoniyhdeller
authored andcommitted
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: cc5d018 ("[PATCH] powerpc: Remove device_node addrs/n_addr") Cc: [email protected] Signed-off-by: Miaoqian Lin <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 18cd0a9 commit eb53368

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/video/fbdev/valkyriefb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,13 @@ static int __init valkyriefb_init(void)
329329

330330
if (of_address_to_resource(dp, 0, &r)) {
331331
printk(KERN_ERR "can't find address for valkyrie\n");
332+
of_node_put(dp);
332333
return 0;
333334
}
334335

335336
frame_buffer_phys = r.start;
336337
cmap_regs_phys = r.start + 0x304000;
338+
of_node_put(dp);
337339
}
338340
#endif /* ppc (!CONFIG_MAC) */
339341

0 commit comments

Comments
 (0)