Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 049c0d57 authored by Srikanth Thokala's avatar Srikanth Thokala Committed by Vinod Koul
Browse files

dmaengine: xilinx: vdma: Check if the segment list is empty in a descriptor



The segment list in a descriptor should be checked for empty, else
it will try to access invalid address for the first call.  This
patch fixes this issue.

Signed-off-by: default avatarSrikanth Thokala <sthokal@xilinx.com>
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent cd166280
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -971,9 +971,11 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan *dchan,
		hw->buf_addr = xt->src_start;

	/* Link the previous next descriptor to current */
	if (!list_empty(&desc->segments)) {
		prev = list_last_entry(&desc->segments,
				       struct xilinx_vdma_tx_segment, node);
		prev->hw.next_desc = segment->phys;
	}

	/* Insert the segment into the descriptor segments list. */
	list_add_tail(&segment->node, &desc->segments);