diff options
author | Nicholas Mc Guire <hofrat@osadl.org> | 2018-06-12 13:22:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-06-28 07:49:06 -0400 |
commit | c2ee2243ce3763fef8da097851b2c07b73e18cdb (patch) | |
tree | b42f5fcc3f6f66c14c76b0d67e35c3e729753ff1 /drivers/media/platform/stm32 | |
parent | f8eb8e5c1f31f059677a80e0a902e64065695fa8 (diff) |
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 37404f91ef8b ("[media] stm32-dcmi: STM32 DCMI camera interface driver")
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
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/stm32')
-rw-r--r-- | drivers/media/platform/stm32/stm32-dcmi.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index 9f6bb4165e54..fcad6de06009 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -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; |