video: fbdev: amba-clcd: Fix refcount leak bugs
authorLiang He <windhl@126.com>
Tue, 19 Jul 2022 08:25:46 +0000 (16:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:11:25 +0000 (11:11 +0200)
commit2688df86c02da6bdc9866b62d974e169a2678883
tree6724887507a6b891c096a2c26c3d9fbac495c54c
parentdb7bc17d33ac1f08d6a9f512eee1a6e13031c968
video: fbdev: amba-clcd: Fix refcount leak bugs

[ Upstream commit 26c2b7d9fac42eb8317f3ceefa4c1a9a9170ca69 ]

In clcdfb_of_init_display(), we should call of_node_put() for the
references returned by of_graph_get_next_endpoint() and
of_graph_get_remote_port_parent() which have increased the refcount.

Besides, we should call of_node_put() both in fail path or when
the references are not used anymore.

Fixes: d10715be03bd ("video: ARM CLCD: Add DT support")
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/amba-clcd.c