media: ov5645: add missing of_node_put() in error path
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 19 Mar 2018 16:14:17 +0000 (12:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:17:55 +0000 (16:17 +0200)
commit1c94830eeea533f617a0642e98dbac51214329a1
treefc1755f126988611519e3ee09d771e488d7df465
parentcc4b4af51c13c0aec5c0368986295eb9dcfcdab1
media: ov5645: add missing of_node_put() in error path

[ Upstream commit 06fe932307d58108a11c3e603517dd2a73a57b80 ]

The device node obtained with of_graph_get_next_endpoint() should be
released by calling of_node_put().  But it was not released when
v4l2_fwnode_endpoint_parse() failed.

This change moves the of_node_put() call before the error check and
fixes the issue.

Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Todor Tomov <todor.tomov@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/i2c/ov5645.c