Skip to content

Commit

Permalink
omap iommu: fix incorrect address for largepage 1st entry
Browse files Browse the repository at this point in the history
There was a potential risk that the following "memset" could override
its range if a given address was not the 1st entry of a
largepage. This is not the case for "iovmm".

Reported-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Hiroshi DOYU authored and Tony Lindgren committed Feb 15, 2010
1 parent 8d33ea5 commit c127c7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/plat-omap/iommu.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* omap iommu: tlb and pagetable primitives
*
* Copyright (C) 2008-2009 Nokia Corporation
* Copyright (C) 2008-2010 Nokia Corporation
*
* Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>,
* Paul Mundt and Toshihiro Kobayashi
Expand Down Expand Up @@ -646,7 +646,7 @@ static size_t iopgtable_clear_entry_core(struct iommu *obj, u32 da)
if (*iopte & IOPTE_LARGE) {
nent *= 16;
/* rewind to the 1st entry */
iopte = (u32 *)((u32)iopte & IOLARGE_MASK);
iopte = iopte_offset(iopgd, (da & IOLARGE_MASK));
}
bytes *= nent;
memset(iopte, 0, nent * sizeof(*iopte));
Expand Down

0 comments on commit c127c7d

Please sign in to comment.