diff options
| author | Charan Teja Reddy <charante@codeaurora.org> | 2017-04-18 18:45:19 +0530 |
|---|---|---|
| committer | Charan Teja Reddy <charante@codeaurora.org> | 2017-04-21 10:01:15 +0530 |
| commit | 182caa19ec45a447e16a3d5e99d76f41b06a63d4 (patch) | |
| tree | 3b92e903a1e9c9004b87f4cc432ae235cca2a41a | |
| parent | 26db194916bdb891d9b2865d38cbe8068760d8ce (diff) | |
arm: dma-mapping: set the proper bitmap size
Set the size of bitmap area properly to ensure the proper iova address
to be returned by the bitmap_() API's through alloc_iova(). The current
implementation causes the bitmap index search out of bounds of a page
which can lead to the randomn corruption issues.
Change-Id: Ie57ca0b7465c91d318145ed270b7d47d822c8eeb
Fixes:I88ddd98a76b ("arm/arm64: dma-mapping: Fix iova region size")
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
| -rw-r--r-- | arch/arm/mm/dma-mapping.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index b58d8e0d9ed1..a000ced6d525 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -2074,7 +2074,7 @@ arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, u64 size) mapping->nr_bitmaps = 1; mapping->extensions = extensions; mapping->base = base; - mapping->bits = bits; + mapping->bits = BITS_PER_BYTE * bitmap_size; spin_lock_init(&mapping->lock); |
