Skip to content

Commit

Permalink
vmalloc.c: fix flushing in vmap_page_range()
Browse files Browse the repository at this point in the history
The flush_cache_vmap in vmap_page_range() is called with the end of the
range twice.  The following patch fixes this for me.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Adam Lackorzynski authored and Linus Torvalds committed Jan 4, 2009
1 parent 7b574b7 commit 2e4e27c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,12 @@ static int vmap_pud_range(pgd_t *pgd, unsigned long addr,
*
* Ie. pte at addr+N*PAGE_SIZE shall point to pfn corresponding to pages[N]
*/
static int vmap_page_range(unsigned long addr, unsigned long end,
static int vmap_page_range(unsigned long start, unsigned long end,
pgprot_t prot, struct page **pages)
{
pgd_t *pgd;
unsigned long next;
unsigned long addr = start;
int err = 0;
int nr = 0;

Expand All @@ -167,7 +168,7 @@ static int vmap_page_range(unsigned long addr, unsigned long end,
if (err)
break;
} while (pgd++, addr = next, addr != end);
flush_cache_vmap(addr, end);
flush_cache_vmap(start, end);

if (unlikely(err))
return err;
Expand Down

0 comments on commit 2e4e27c

Please sign in to comment.