summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLaurent Dufour <ldufour@linux.vnet.ibm.com>2017-02-14 17:45:10 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2017-03-21 22:08:53 +1100
commitc2294e0ffe741c8b34c630a71c7dc44d30503538 (patch)
tree54a259cd001fca0c38082d52a666ce9f084ff74b /arch
parent20f13b95eef1b3ca75535e313357b0b096d39336 (diff)
downloadlinux-c2294e0ffe741c8b34c630a71c7dc44d30503538.tar.bz2
powerpc/mm: Move mmap_sem unlock up from do_sigbus
Move mmap_sem releasing in the do_sigbus()'s unique caller : mm_fault_error() No functional changes. Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/mm/fault.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 51def8a515be..2d77c1c8014a 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -120,8 +120,6 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address,
siginfo_t info;
unsigned int lsb = 0;
- up_read(&current->mm->mmap_sem);
-
if (!user_mode(regs))
return MM_FAULT_ERR(SIGBUS);
@@ -185,8 +183,10 @@ static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault)
return MM_FAULT_RETURN;
}
- if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE))
+ if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) {
+ up_read(&current->mm->mmap_sem);
return do_sigbus(regs, addr, fault);
+ }
/* We don't understand the fault code, this is fatal */
BUG();