If an incorrectly configured media pipeline is started, the allocated
dma descriptors aren't freed. This leads to kernel oops when pipeline
is configured correctly and run subsequently. This patch fixes this
issue by freeing the descriptors on media pipeline start failure.
Signed-off-by: Vishal Sagar <vishal.sagar@xilinx.com>
Tested-by: Anil Kumar Mamidala <amamidal@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
return 0;
error_stop:
- dmaengine_terminate_all(dma->dma);
media_pipeline_stop(&dma->video.entity);
error:
+ dmaengine_terminate_all(dma->dma);
/* Give back all queued buffers to videobuf2. */
spin_lock_irq(&dma->queued_lock);
list_for_each_entry_safe(buf, nbuf, &dma->queued_bufs, queue) {