Re: [PATCH] mm: Fix wrong kunmap_atomic() pointer
From: Hugh Dickins
Date: Sun Jun 05 2011 - 15:20:55 EST
On Fri, 3 Jun 2011, Steven Rostedt wrote:
>
> Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
Thanks, Steve: I'm afraid I left a number of those "pte - 1"
landmines around, and this isn't the first one to blow up.
Acked-by: Hugh Dickins <hughd@xxxxxxxxxx>
> diff --git a/mm/memory.c b/mm/memory.c
> index 6953d39..922dcd6 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1112,11 +1112,13 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
> int force_flush = 0;
> int rss[NR_MM_COUNTERS];
> spinlock_t *ptl;
> + pte_t *start_pte;
> pte_t *pte;
>
> again:
> init_rss_vec(rss);
> - pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
> + start_pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
> + pte = start_pte;
> arch_enter_lazy_mmu_mode();
> do {
> pte_t ptent = *pte;
> @@ -1196,7 +1198,7 @@ again:
>
> add_mm_rss_vec(mm, rss);
> arch_leave_lazy_mmu_mode();
> - pte_unmap_unlock(pte - 1, ptl);
> + pte_unmap_unlock(start_pte, ptl);
>
> /*
> * mmu_gather ran out of room to batch pages, we break out of
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/