Commit eb53368f authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Helge Deller
Browse files

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: cc5d0189 ("[PATCH] powerpc: Remove device_node addrs/n_addr")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 18cd0a9c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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) */