From 8bc613befaec184b59bf3405e8d06fafdc209484 Mon Sep 17 00:00:00 2001 From: Rickard Strandqvist Date: Fri, 30 May 2014 01:11:58 +0200 Subject: metag: hugetlbpage: Remove null pointer checks that could never happen There are inconsistent NULL checks in hugetlb_get_unmapped_area_existing(). The last conditional block in the loop checks vma, but vma is dereferenced after that. Due to the checks above however (bearing in mind after_huge is either 0 or 1) vma is guaranteed not to be NULL here, so remove that part of the check. Signed-off-by: Rickard Strandqvist [james.hogan@imgtec.com: remove brackets and expand commit message] Signed-off-by: James Hogan --- arch/metag/mm/hugetlbpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/metag/mm') diff --git a/arch/metag/mm/hugetlbpage.c b/arch/metag/mm/hugetlbpage.c index 3c52fa6d0f8e..3c32075d2945 100644 --- a/arch/metag/mm/hugetlbpage.c +++ b/arch/metag/mm/hugetlbpage.c @@ -173,7 +173,7 @@ new_search: mm->context.part_huge = 0; return addr; } - if (vma && (vma->vm_flags & MAP_HUGETLB)) { + if (vma->vm_flags & MAP_HUGETLB) { /* space after a huge vma in 2nd level page table? */ if (vma->vm_end & HUGEPT_MASK) { after_huge = 1; -- cgit v1.2.3-59-g8ed1b