Commit bc312852 authored by Subhajit Paul's avatar Subhajit Paul Committed by Anand Balagopalakrishnan

km: fix error in calculating size of page array

This function was earlier calculating npages in a wrong way,
probably due to wrong placement of braces.

As a result, the allocation size was always much larger than
what is actually required.

Change-Id: Ic25203eca7447bc0eb24b948a3385920cddc032e
Signed-off-by: default avatarSubhajit Paul <>
Reviewed-on: default avatarEric Ruei <>
parent e68719ba
......@@ -127,7 +127,7 @@ PVRSRV_ERROR DmaBufImportAndAcquirePhysAddr(IMG_INT32 i32DmaBufFD,
for_each_sg(import->sg_table->sgl, sg, import->sg_table->nents, i)
npages += PAGE_ALIGN(sg_dma_len(sg) / PAGE_SIZE);
npages += (PAGE_ALIGN(sg_dma_len(sg)) / PAGE_SIZE);
/* The following allocation will be freed by the caller */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment