projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cd16628
)
dmaengine: xilinx: vdma: Check if the segment list is empty in a descriptor
author
Srikanth Thokala
<srikanth.thokala@xilinx.com>
Wed, 5 Nov 2014 18:37:00 +0000
(20:37 +0200)
committer
Vinod Koul
<vinod.koul@intel.com>
Thu, 6 Nov 2014 07:41:47 +0000
(13:11 +0530)
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: Srikanth Thokala <sthokal@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/xilinx/xilinx_vdma.c
patch
|
blob
|
history
diff --git
a/drivers/dma/xilinx/xilinx_vdma.c
b/drivers/dma/xilinx/xilinx_vdma.c
index a6e64767186e7d24e0b241dc97f3225196c85c39..10937945a5272992b38a3e80bdbfe2a42d4938d5 100644
(file)
--- a/
drivers/dma/xilinx/xilinx_vdma.c
+++ b/
drivers/dma/xilinx/xilinx_vdma.c
@@
-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 */
- prev = list_last_entry(&desc->segments,
- struct xilinx_vdma_tx_segment, node);
- prev->hw.next_desc = segment->phys;
+ 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);