]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
xilinx: v4l: dma: In case of error xvip_pipeline_start_stop should return gracefully
authorSaurabh Sengar <saurabh.singh@xilinx.com>
Mon, 8 Oct 2018 04:42:47 +0000 (10:12 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 8 Oct 2018 08:58:36 +0000 (10:58 +0200)
In case of any error inside the xvip_pipeline_start_stop function, it
should release the lock taken and do media graph cleanup.

Signed-off-by: Saurabh Sengar <saurabh.singh@xilinx.com>
Reviewed-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/media/platform/xilinx/xilinx-dma.c

index 4cf00779d486866a6e7dba60d139c14e550cfae2..19f78a0359f62a24e5c782fe20d7a9f9436c0c07 100644 (file)
@@ -121,10 +121,8 @@ static int xvip_pipeline_start_stop(struct xvip_composite_device *xdev,
 
        /* Walk the graph to locate the subdev nodes */
        ret = media_graph_walk_init(&graph, mdev);
-       if (ret) {
-               mutex_unlock(&mdev->graph_mutex);
-               return ret;
-       }
+       if (ret)
+               goto error;
 
        media_graph_walk_start(&graph, entity);
 
@@ -148,11 +146,12 @@ static int xvip_pipeline_start_stop(struct xvip_composite_device *xdev,
                        if (start && ret < 0 && ret != -ENOIOCTLCMD) {
                                dev_err(xdev->dev, "s_stream is failed on subdev\n");
                                xvip_subdev_set_streaming(xdev, subdev, !start);
-                               return ret;
+                               goto error;
                        }
                }
        }
 
+error:
        mutex_unlock(&mdev->graph_mutex);
        media_graph_walk_cleanup(&graph);