From 4d97746570a6e51f834bbf2758a4b4c33308428d Mon Sep 17 00:00:00 2001 From: Satish Kumar Nagireddy Date: Wed, 10 Oct 2018 11:43:17 -0700 Subject: [PATCH] xilinx: v4l: vipp: Avoid decrementing refcount of a node twice In the current implementation, driver is calling of_graph_get_next_endpoint() and of_node_put() functions to get next endpoint and decrement refcount of a node. As the former function is already decrementing refcount, there is no need of calling the later function which decrements the refcount again. This patch avoids calling of_node_put() function in driver, as the same has been taken care in of_graph_get_next_endpoint() implementation. Signed-off-by: Satish Kumar Nagireddy Reviewed-by: Hyun Kwon Signed-off-by: Michal Simek --- drivers/media/platform/xilinx/xilinx-vipp.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c index b9a1acabbdae..5509040171e1 100644 --- a/drivers/media/platform/xilinx/xilinx-vipp.c +++ b/drivers/media/platform/xilinx/xilinx-vipp.c @@ -98,7 +98,6 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev, if (next == NULL) break; - of_node_put(ep); ep = next; dev_dbg(xdev->dev, "processing endpoint %pOF\n", ep); @@ -183,7 +182,6 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev, } } - of_node_put(ep); return ret; } @@ -252,7 +250,6 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev) if (next == NULL) break; - of_node_put(ep); ep = next; dev_dbg(xdev->dev, "processing endpoint %pOF\n", ep); @@ -328,7 +325,6 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev) } } - of_node_put(ep); return ret; } -- 2.39.2