media: xilinx-video: fix bad of_node_put() on endpoint error
Subsystems (3)
PATCH 1/1 media: xilinx-video: fix bad of_node_put() on endpoint error
The fwnode_graph_get_next_endpoint() returns an 'endpoint' node pointer with refcount incremented, and refcount of the passed as a previous 'endpoint' node is decremented.
So when iterating over all nodes using fwnode_graph_get_next_endpoint(), we don't need to call fwnode_handle_put() for each node except for error exit paths. Otherwise we get "OF: ERROR: Bad of_node_put() on ..." messages.
--- drivers/media/platform/xilinx/xilinx-vipp.c | 2 -- 1 file changed, 2 deletions(-)
drivers/media/platform/xilinx/xilinx-vipp.c +0 -2
@@ -377,8 +377,6 @@ static int xvip_graph_parse_one(struct xvip_composite_device *xdev, goto err_notifier_cleanup; } -fwnode_handle_put (ep); -/* Skip entities that we have already processed. */ if (remote ==of_fwnode_handle (xdev->dev->of_node) ||xvip_graph_find_entity (xdev, remote)) {
Signature · 1 line
2.7.4
Hi Akinobu,
Thanks for the patch.
Quoted 9 lines · Akinobu Mita
The
fwnode_graph_get_next_endpoint()returns an 'endpoint' node pointer with refcount incremented, and refcount of the passed as a previous 'endpoint' node is decremented.So when iterating over all nodes using
fwnode_graph_get_next_endpoint(), we don't need to callfwnode_handle_put()for each node except for error exit paths. Otherwise we get "OF: ERROR: Badof_node_put()on ..." messages.
Quoted 6 lines
Fixes d079f94c9046 ("media: platform: Switch to v4l2_async_notifier_add_subdev")Cc Steve Longerbeam <[email protected]>Cc Hyun Kwon <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Signed-off-by Akinobu Mita <[email protected]>
This looks good to me,
Thanks,
-hyun
Quoted 20 lines
--- drivers/media/platform/xilinx/xilinx-vipp.c | 2 -- 1 file changed, 2 deletions(-)drivers/media/platform/xilinx/xilinx-vipp.c +0
-2@@ -377,8 +377,6 @@ static int xvip_graph_parse_one(struct xvip_composite_device *xdev, goto err_notifier_cleanup; } -fwnode_handle_put (ep); -/* Skip entities that we have already processed. */ if (remote ==of_fwnode_handle (xdev->dev->of_node) ||xvip_graph_find_entity (xdev, remote)) {Signature · 1 line
2.7.4