X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=arch%2Fsh%2Fmm%2Ffault.c;h=541dc610150888e706977c7944c42ab1d61d7437;hb=026f8f612a137324869b6dbdf1d526d176e1766e;hp=1f49c28affa90495047c6b82577b2d5221bc089b;hpb=9e97d14b4923da524d202f2e005d5d30b70db9d6;p=~andy%2Flinux diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index 1f49c28affa..541dc610150 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c @@ -400,9 +400,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, struct mm_struct *mm; struct vm_area_struct * vma; int fault; - int write = error_code & FAULT_CODE_WRITE; - unsigned int flags = (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | - (write ? FAULT_FLAG_WRITE : 0)); + unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; tsk = current; mm = tsk->mm; @@ -476,6 +474,11 @@ good_area: set_thread_fault_code(error_code); + if (user_mode(regs)) + flags |= FAULT_FLAG_USER; + if (error_code & FAULT_CODE_WRITE) + flags |= FAULT_FLAG_WRITE; + /* * If for any reason at all we couldn't handle the fault, * make sure we exit gracefully rather than endlessly redo