Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350092
b: refs/heads/master
c: 5a2df66
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov committed Feb 8, 2013
1 parent 5a686c8 commit 369af75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 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: 9b545df809644912552360054c7bbe8b8a9e01fa
refs/heads/master: 5a2df662aafdabffb2cf3adb780a5adf66dfb3bc
27 changes: 9 additions & 18 deletions trunk/kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,23 +1290,18 @@ void uprobe_copy_process(struct task_struct *t)
}

/*
* Allocate a uprobe_task object for the task.
* Called when the thread hits a breakpoint for the first time.
* Allocate a uprobe_task object for the task if if necessary.
* Called when the thread hits a breakpoint.
*
* Returns:
* - pointer to new uprobe_task on success
* - NULL otherwise
*/
static struct uprobe_task *add_utask(void)
static struct uprobe_task *get_utask(void)
{
struct uprobe_task *utask;

utask = kzalloc(sizeof *utask, GFP_KERNEL);
if (unlikely(!utask))
return NULL;

current->utask = utask;
return utask;
if (!current->utask)
current->utask = kzalloc(sizeof(struct uprobe_task), GFP_KERNEL);
return current->utask;
}

/* Prepare to single-step probed instruction out of line. */
Expand Down Expand Up @@ -1505,13 +1500,9 @@ static void handle_swbp(struct pt_regs *regs)
if (unlikely(!test_bit(UPROBE_COPY_INSN, &uprobe->flags)))
goto out;

utask = current->utask;
if (!utask) {
utask = add_utask();
/* Cannot allocate; re-execute the instruction. */
if (!utask)
goto out;
}
utask = get_utask();
if (!utask)
goto out; /* re-execute the instruction. */

handler_chain(uprobe, regs);
if (can_skip_sstep(uprobe, regs))
Expand Down

0 comments on commit 369af75

Please sign in to comment.