Skip to content

Commit

Permalink
metag: hugetlbpage: Remove null pointer checks that could never happen
Browse files Browse the repository at this point in the history
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 <rickard_strandqvist@spectrumdigital.se>
[james.hogan@imgtec.com: remove brackets and expand commit message]
Signed-off-by: James Hogan <james.hogan@imgtec.com>
  • Loading branch information
Rickard Strandqvist authored and James Hogan committed Jun 16, 2014
1 parent 7171511 commit 8bc613b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/metag/mm/hugetlbpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ hugetlb_get_unmapped_area_existing(unsigned long len)
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;
Expand Down

0 comments on commit 8bc613b

Please sign in to comment.