summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/atmel/atmel-isi.c
diff options
context:
space:
mode:
authorNicholas Mc Guire <hofrat@osadl.org>2018-06-01 09:30:14 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-06-28 06:50:28 -0400
commit4f9195e3f88c13de94f5828f53d0ffab00d20e6d (patch)
treeaecc79744749acdbf3959cf299c10fd79d4aa86a /drivers/media/platform/atmel/atmel-isi.c
parente8ced209510164f0b54d4bb2a34d243a8af8f561 (diff)
downloadlinux-stable-4f9195e3f88c13de94f5828f53d0ffab00d20e6d.tar.gz
linux-stable-4f9195e3f88c13de94f5828f53d0ffab00d20e6d.tar.bz2
linux-stable-4f9195e3f88c13de94f5828f53d0ffab00d20e6d.zip
media: atmel-isi: move of_node_put() to cover success branch as well
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>
Diffstat (limited to 'drivers/media/platform/atmel/atmel-isi.c')
-rw-r--r--drivers/media/platform/atmel/atmel-isi.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c
index 85fc7b98b660..e8db4df1e7c4 100644
--- a/drivers/media/platform/atmel/atmel-isi.c
+++ b/drivers/media/platform/atmel/atmel-isi.c
@@ -1111,10 +1111,9 @@ static int isi_graph_parse(struct atmel_isi *isi, 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 */
isi->entity.node = remote;