Message ID | 20220421233607.E7E09C385A7@smtp.kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [01/13] mm/hwpoison: fix race between hugetlb free/demotion and memory_failure_hugetlb() | expand |
--- a/kernel/kcov.c~kcov-dont-generate-a-warning-on-vm_insert_pages-failure +++ a/kernel/kcov.c @@ -475,8 +475,11 @@ static int kcov_mmap(struct file *filep, vma->vm_flags |= VM_DONTEXPAND; for (off = 0; off < size; off += PAGE_SIZE) { page = vmalloc_to_page(kcov->area + off); - if (vm_insert_page(vma, vma->vm_start + off, page)) - WARN_ONCE(1, "vm_insert_page() failed"); + res = vm_insert_page(vma, vma->vm_start + off, page); + if (res) { + pr_warn_once("kcov: vm_insert_page() failed\n"); + return res; + } } return 0; exit: