Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58927533 authored by Rik van Riel's avatar Rik van Riel Committed by Linus Torvalds
Browse files

mmap: check ->vm_ops before dereferencing



Check whether the VMA has a vm_ops before calling close, just
like we check vm_ops before calling open a few dozen lines
higher up in the function.

Signed-off-by: default avatarRik van Riel <riel@redhat.com>
Reported-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a231a1f2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1977,6 +1977,7 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
		return 0;

	/* Clean everything up if vma_adjust failed. */
	if (new->vm_ops && new->vm_ops->close)
		new->vm_ops->close(new);
	if (new->vm_file) {
		if (vma->vm_flags & VM_EXECUTABLE)