summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>2012-06-01 14:49:50 +0530
committerAnton Arapov <anton@redhat.com>2012-10-29 11:22:02 +0100
commitbe0f7425523328dddb19addb33ee89a530bba8c8 (patch)
treed04121bc9482ab1655fa2b18c76b373340d161a3
parent7d558cd9c7b18e4b16953265aa0da45e63f3b968 (diff)
downloadkernel-uprobes-be0f7425523328dddb19addb33ee89a530bba8c8.zip
kernel-uprobes-be0f7425523328dddb19addb33ee89a530bba8c8.tar.gz
kernel-uprobes-be0f7425523328dddb19addb33ee89a530bba8c8.tar.xz
uprobes: Remove redundant lock_page/unlock_page
Since read_opcode() reads from the referenced page and doesnt modify the page contents nor the page attributes, there is no need to lock the page. Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
-rw-r--r--kernel/events/uprobes.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index c08a22d..7cff24c 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -280,12 +280,10 @@ static int read_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_
if (ret <= 0)
return ret;
- lock_page(page);
vaddr_new = kmap_atomic(page);
vaddr &= ~PAGE_MASK;
memcpy(opcode, vaddr_new + vaddr, UPROBE_SWBP_INSN_SIZE);
kunmap_atomic(vaddr_new);
- unlock_page(page);
put_page(page);