[PATCH] mm/memory.c: Convert to use vmf_error()
From: Souptick Joarder
Date: Thu Sep 05 2019 - 14:37:11 EST
Convert to use vmf_error() here.
Signed-off-by: Souptick Joarder <jrdr.linux@xxxxxxxxx>
---
mm/memory.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index e2bb51b..1302be32 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1750,13 +1750,10 @@ static vm_fault_t __vm_insert_mixed(struct vm_area_struct *vma,
} else {
return insert_pfn(vma, addr, pfn, pgprot, mkwrite);
}
-
- if (err == -ENOMEM)
- return VM_FAULT_OOM;
- if (err < 0 && err != -EBUSY)
- return VM_FAULT_SIGBUS;
-
- return VM_FAULT_NOPAGE;
+ if (!err || err == -EBUSY)
+ return VM_FAULT_NOPAGE;
+ else
+ return vmf_error(err);
}
vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
--
1.9.1