lkml.org 
[lkml]   [2003]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] pte_alloc_kernel needs additional check
Paul Larson <plars@linuxtestproject.org> wrote:
>
> This applies against 2.5.63.
> pte_alloc_kernel needs a check for pmd_present(*pmd) at the end.
>
> Thanks,
> Paul Larson
>
> --- linux-2.5.63/mm/memory.c Mon Feb 24 13:05:31 2003
> +++ linux-2.5.63-fix/mm/memory.c Mon Feb 24 15:45:05 2003
> @@ -186,7 +186,9 @@
> pmd_populate_kernel(mm, pmd, new);
> }
> out:
> - return pte_offset_kernel(pmd, address);
> + if (pmd_present(*pmd))
> + return pte_offset_kernel(pmd, address);
> + return NULL;
> }
> #define PTE_TABLE_MASK ((PTRS_PER_PTE-1) * sizeof(pte_t))
> #define PMD_TABLE_MASK ((PTRS_PER_PMD-1) * sizeof(pmd_t))

Confused. I cannot see a codepath which makes this test necessary?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.031 / U:2.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site