Author: blueswirl Date: 2007-05-17 21:07:21 +0200 (Thu, 17 May 2007) New Revision: 146
Modified: openbios-devel/drivers/iommu.c Log: Fix overallocation
Modified: openbios-devel/drivers/iommu.c =================================================================== --- openbios-devel/drivers/iommu.c 2007-05-07 20:02:01 UTC (rev 145) +++ openbios-devel/drivers/iommu.c 2007-05-17 19:07:21 UTC (rev 146) @@ -194,7 +194,7 @@ unsigned int mva;
off = pa & (PAGE_SIZE - 1); - npages = (off + size + (PAGE_SIZE - 1)) / PAGE_SIZE; + npages = (off + (size - 1) + (PAGE_SIZE - 1)) / PAGE_SIZE; pa &= ~(PAGE_SIZE - 1);
va = mem_alloc(&cio, npages * PAGE_SIZE, PAGE_SIZE);