Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334765
b: refs/heads/master
c: 076a365
h: refs/heads/master
i:
  334763: f27b5e3
v: v3
  • Loading branch information
Oleg Nesterov committed Oct 7, 2012
1 parent 2e66118 commit cce6ca9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a5f658b71bc622b731961ea3addcf146ed3c599f
refs/heads/master: 076a365b3da99b68c5d58e394714d0611f1fa002
12 changes: 6 additions & 6 deletions trunk/kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static int verify_opcode(struct page *page, unsigned long vaddr, uprobe_opcode_t
return 0;
} else {
if (!is_swbp) /* unregister: was it changed by us? */
return -EINVAL;
return 0;
}

return 1;
Expand Down Expand Up @@ -616,15 +616,15 @@ install_breakpoint(struct uprobe *uprobe, struct mm_struct *mm,
return ret;
}

static void
static int
remove_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, unsigned long vaddr)
{
/* can happen if uprobe_register() fails */
if (!test_bit(MMF_HAS_UPROBES, &mm->flags))
return;
return 0;

set_bit(MMF_RECALC_UPROBES, &mm->flags);
set_orig_insn(&uprobe->arch, mm, vaddr);
return set_orig_insn(&uprobe->arch, mm, vaddr);
}

/*
Expand Down Expand Up @@ -740,7 +740,7 @@ static int register_for_each_vma(struct uprobe *uprobe, bool is_register)
struct mm_struct *mm = info->mm;
struct vm_area_struct *vma;

if (err)
if (err && is_register)
goto free;

down_write(&mm->mmap_sem);
Expand All @@ -756,7 +756,7 @@ static int register_for_each_vma(struct uprobe *uprobe, bool is_register)
if (is_register)
err = install_breakpoint(uprobe, mm, vma, info->vaddr);
else
remove_breakpoint(uprobe, mm, info->vaddr);
err |= remove_breakpoint(uprobe, mm, info->vaddr);

unlock:
up_write(&mm->mmap_sem);
Expand Down

0 comments on commit cce6ca9

Please sign in to comment.