Skip to content

Commit 440e9a2

Browse files
dliviugregkh
authored andcommitted
staging: android: ion: Set the length of the DMA sg entries in buffer
commit 70bc916b2c80913753fb188d4daee50a64d21ba0 upstream. ion_buffer_create() will allocate a buffer and then create a DMA mapping for it, but it forgot to set the length of the page entries. Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Jon Medhurst <tixy@linaro.org> Acked-by: Laura Abbott <labbott@redhat.com> Cc: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c149165 commit 440e9a2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • drivers/staging/android/ion

drivers/staging/android/ion/ion.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,10 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
251251
* memory coming from the heaps is ready for dma, ie if it has a
252252
* cached mapping that mapping has been invalidated
253253
*/
254-
for_each_sg(buffer->sg_table->sgl, sg, buffer->sg_table->nents, i)
254+
for_each_sg(buffer->sg_table->sgl, sg, buffer->sg_table->nents, i) {
255255
sg_dma_address(sg) = sg_phys(sg);
256+
sg_dma_len(sg) = sg->length;
257+
}
256258
mutex_lock(&dev->buffer_lock);
257259
ion_buffer_add(dev, buffer);
258260
mutex_unlock(&dev->buffer_lock);

0 commit comments

Comments
 (0)