Skip to content
Unverified Commit 5b3c219b authored by popcornmix's avatar popcornmix Committed by GitHub
Browse files

dw-axi-dmac-platform: Avoid trampling with zero length buffer



This code:
for_each_sg(sgl, sg, sg_len, i)
  num_sgs += DIV_ROUND_UP(sg_dma_len(sg), axi_block_len);

determines how many hw_desc are allocated.
If sg_dma_len(sg)=0 we don't allocate for this sgl.

However in the next loop, we will increment loop
for this case, and loop gets higher than num_sgs
and we trample memory.

Signed-off-by: default avatarDom Cobley <popcornmix@gmail.com>
parent 9577122a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment