Skip to content

Commit 8bc613b

Browse files
Rickard StrandqvistJames Hogan
authored andcommitted
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 <rickard_strandqvist@spectrumdigital.se> [james.hogan@imgtec.com: remove brackets and expand commit message] Signed-off-by: James Hogan <james.hogan@imgtec.com>
1 parent 7171511 commit 8bc613b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎arch/metag/mm/hugetlbpage.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ hugetlb_get_unmapped_area_existing(unsigned long len)
173173
mm->context.part_huge = 0;
174174
return addr;
175175
}
176-
if (vma && (vma->vm_flags & MAP_HUGETLB)) {
176+
if (vma->vm_flags & MAP_HUGETLB) {
177177
/* space after a huge vma in 2nd level page table? */
178178
if (vma->vm_end & HUGEPT_MASK) {
179179
after_huge = 1;

0 commit comments

Comments
 (0)