]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
media: xilinx: Fix error handling
authorRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Mon, 26 May 2014 11:32:29 +0000 (17:02 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 27 May 2014 11:28:20 +0000 (13:28 +0200)
Fix error handling in xvip_graph_dma_init()
Avoid multiple free of vb2 dma context

Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/media/platform/xilinx/xilinx-dma.c

index 409aa699f9819e1f567c371216506b9007208326..f7c379fc9ce646cac673eb415d18e219531a74d2 100644 (file)
@@ -978,7 +978,6 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,
        return 0;
 
 error:
-       vb2_dma_contig_cleanup_ctx(dma->alloc_ctx);
        xvip_dma_cleanup(dma);
        return ret;
 }
@@ -991,7 +990,9 @@ void xvip_dma_cleanup(struct xvip_dma *dma)
        if (dma->dma)
                dma_release_channel(dma->dma);
 
-       vb2_dma_contig_cleanup_ctx(dma->alloc_ctx);
+       if (!IS_ERR_OR_NULL(dma->alloc_ctx))
+               vb2_dma_contig_cleanup_ctx(dma->alloc_ctx);
+
        media_entity_cleanup(&dma->video.entity);
 
        mutex_destroy(&dma->lock);