* arm: mm: fix faulty calculation of area to perform cache operation
@ 2012-03-29 9:55 Cho KyongHo
2012-03-29 12:10 ` Russell King - ARM Linux
0 siblings, 1 reply; 2+ messages in thread
From: Cho KyongHo @ 2012-03-29 9:55 UTC (permalink / raw)
To: linux-arch, linux-samsung-soc, linux-arm-kernel
Cc: 'Russell King - ARM Linux', kgene.kim,
'Younglak Kim', 'Sanghyun Lee', wooki.min
In dma_cache_maint_page(), if offset is larger than PAGE_SIZE,
len becomes PAGE_SIZE - offset. If size is smaller than
PAGE_SIZE - offset, next calcuation of left cause overflow.
Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>
---
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 1aa664a..14f53b6 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -517,7 +517,7 @@ static void dma_cache_maint_page(struct page *page, unsigned long offset,
page += offset / PAGE_SIZE;
offset %= PAGE_SIZE;
}
- len = PAGE_SIZE - offset;
+ len = min_t(size_t, PAGE_SIZE - offset, len);
}
vaddr = kmap_high_get(page);
if (vaddr) {
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: arm: mm: fix faulty calculation of area to perform cache operation
2012-03-29 9:55 arm: mm: fix faulty calculation of area to perform cache operation Cho KyongHo
@ 2012-03-29 12:10 ` Russell King - ARM Linux
0 siblings, 0 replies; 2+ messages in thread
From: Russell King - ARM Linux @ 2012-03-29 12:10 UTC (permalink / raw)
To: Cho KyongHo
Cc: linux-arch, linux-samsung-soc, linux-arm-kernel, kgene.kim,
'Younglak Kim', 'Sanghyun Lee', wooki.min
On Thu, Mar 29, 2012 at 06:55:32PM +0900, Cho KyongHo wrote:
> In dma_cache_maint_page(), if offset is larger than PAGE_SIZE,
> len becomes PAGE_SIZE - offset. If size is smaller than
> PAGE_SIZE - offset, next calcuation of left cause overflow.
It is invalid for offset to be larger than PAGE_SIZE here.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-29 12:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-29 9:55 arm: mm: fix faulty calculation of area to perform cache operation Cho KyongHo
2012-03-29 12:10 ` Russell King - ARM Linux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).