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>
return 0;
error:
- vb2_dma_contig_cleanup_ctx(dma->alloc_ctx);
xvip_dma_cleanup(dma);
return ret;
}
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);