提交 fc36f595 编写于 作者: O Oleg Nesterov 提交者: Ingo Molnar

uprobes: Copy_insn() should not return -ENOMEM if __copy_insn() fails

copy_insn() returns -ENOMEM if the first __copy_insn() fails,
it should return the correct error code.
Signed-off-by: NOleg Nesterov <oleg@redhat.com>
Acked-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Acked-by: NAnanth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anton Arapov <anton@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120615154344.GA9601@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 d436615e
...@@ -641,10 +641,10 @@ static int copy_insn(struct uprobe *uprobe, struct file *filp) ...@@ -641,10 +641,10 @@ static int copy_insn(struct uprobe *uprobe, struct file *filp)
/* Instruction at the page-boundary; copy bytes in second page */ /* Instruction at the page-boundary; copy bytes in second page */
if (nbytes < bytes) { if (nbytes < bytes) {
if (__copy_insn(mapping, filp, uprobe->arch.insn + nbytes, int err = __copy_insn(mapping, filp, uprobe->arch.insn + nbytes,
bytes - nbytes, uprobe->offset + nbytes)) bytes - nbytes, uprobe->offset + nbytes);
return -ENOMEM; if (err)
return err;
bytes = nbytes; bytes = nbytes;
} }
return __copy_insn(mapping, filp, uprobe->arch.insn, bytes, uprobe->offset); return __copy_insn(mapping, filp, uprobe->arch.insn, bytes, uprobe->offset);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册