The of_node_put() was only covering the error branch but missed the
success branch so the refcount for ep which
of_graph_get_remote_port_parent() incremented on success would was
not being decremented.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
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 */
isi->entity.node = remote;