提交 c2ee2243 编写于 作者: N Nicholas Mc Guire 提交者: Mauro Carvalho Chehab

media: stm32-dcmi: add mandatory of_node_put() in success path

The endpoint allocated by of_graph_get_next_endpoint() needs an of_node_put()
in both error and success path. As  ep  is not used the refcount decrement
can be right after the last use of  ep.

Fixes: commit 37404f91 ("[media] stm32-dcmi: STM32 DCMI camera interface driver")
Signed-off-by: NNicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 f8eb8e5c
......@@ -1572,10 +1572,9 @@ static int dcmi_graph_parse(struct stm32_dcmi *dcmi, struct device_node *node)
return -EINVAL;
remote = of_graph_get_remote_port_parent(ep);
if (!remote) {
of_node_put(ep);
of_node_put(ep);
if (!remote)
return -EINVAL;
}
/* Remote node to connect */
dcmi->entity.node = remote;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册