mm/mmap: Avoid dereferencing next on null in BUG_ON()
Subsystems (2)
PATCH 1/1 mm/mmap: Avoid dereferencing next on null in BUG_ON()
Check there is a next before checking the bounds.
Signed-off-by Liam R. Howlett <[email protected]>
--- mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mmap.c +1 -1
@@ -583,7 +583,7 @@ inline int vma_expand(struct ma_state *mas, struct vm_area_struct *vma, }/* Not merging but overwriting any part of next is not handled. */ -VM_BUG_ON (!remove_next && next != vma && end > next->vm_start); +VM_BUG_ON (next && !remove_next && next != vma && end > next->vm_start);/* Only handles expanding */ VM_BUG_ON (vma->vm_start < start || vma->vm_end > end);
Signature · 1 line
2.35.1