[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220618025647.4057077-1-windhl@126.com>
Date: Sat, 18 Jun 2022 10:56:47 +0800
From: Liang He <windhl@....com>
To: deller@....de, christophe.leroy@...roup.eu
Cc: windhl@....com, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] video: fbdev: Fix refcount leak bug in valkyriefb.c
In valkyriefb_init(), of_find_node_by_name() will return a node pointer
with refcount incremented. We should use of_node_put() in fail path or
when it is not used anymore.
Signed-off-by: Liang He <windhl@....com>
---
drivers/video/fbdev/valkyriefb.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/video/fbdev/valkyriefb.c b/drivers/video/fbdev/valkyriefb.c
index a6c9d4f26669..20d727a8069d 100644
--- a/drivers/video/fbdev/valkyriefb.c
+++ b/drivers/video/fbdev/valkyriefb.c
@@ -334,10 +334,13 @@ int __init valkyriefb_init(void)
return 0;
if (of_address_to_resource(dp, 0, &r)) {
+ of_node_put(dp);
printk(KERN_ERR "can't find address for valkyrie\n");
return 0;
}
+ of_node_put(dp);
+
frame_buffer_phys = r.start;
cmap_regs_phys = r.start + 0x304000;
}
--
2.25.1
Powered by blists - more mailing lists