summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/traps.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-05-21 15:15:24 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-05-21 15:15:24 +0100
commit4175160b065e74572819a320dcd34129224a4e1c (patch)
tree3298e2c9a7c7db33bf28617875e5429e17eec61c /arch/arm/kernel/traps.c
parentddf90a2ff2c4a9da99acc898a4afeab3e4251fcd (diff)
parent0ec8e7aa8f63f0cacd545fcd7f40f93fde2c0e6e (diff)
downloadblackbird-op-linux-4175160b065e74572819a320dcd34129224a4e1c.tar.gz
blackbird-op-linux-4175160b065e74572819a320dcd34129224a4e1c.zip
Merge branch 'misc' into for-linus
Conflicts: arch/arm/kernel/ptrace.c
Diffstat (limited to 'arch/arm/kernel/traps.c')
-rw-r--r--arch/arm/kernel/traps.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 778454750a6c..3647170e9a16 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -479,14 +479,14 @@ static int bad_syscall(int n, struct pt_regs *regs)
return regs->ARM_r0;
}
-static inline void
+static inline int
do_cache_op(unsigned long start, unsigned long end, int flags)
{
struct mm_struct *mm = current->active_mm;
struct vm_area_struct *vma;
if (end < start || flags)
- return;
+ return -EINVAL;
down_read(&mm->mmap_sem);
vma = find_vma(mm, start);
@@ -496,9 +496,11 @@ do_cache_op(unsigned long start, unsigned long end, int flags)
if (end > vma->vm_end)
end = vma->vm_end;
- flush_cache_user_range(vma, start, end);
+ up_read(&mm->mmap_sem);
+ return flush_cache_user_range(start, end);
}
up_read(&mm->mmap_sem);
+ return -EINVAL;
}
/*
@@ -544,8 +546,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
* the specified region).
*/
case NR(cacheflush):
- do_cache_op(regs->ARM_r0, regs->ARM_r1, regs->ARM_r2);
- return 0;
+ return do_cache_op(regs->ARM_r0, regs->ARM_r1, regs->ARM_r2);
case NR(usr26):
if (!(elf_hwcap & HWCAP_26BIT))
OpenPOWER on IntegriCloud