lkml.org 
[lkml]   [2012]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/5] uprobes: remove check for uprobe variable in handle_swbp()
On 08/07/2012 09:42 PM, Sebastian Andrzej Siewior wrote:
> by the time we get here (after we pass cleanup_ret) uprobe is always is
> set. If it is NULL we leave very early in the code.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> kernel/events/uprobes.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> index 41a2555..c8e5204 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -1528,17 +1528,15 @@ cleanup_ret:
> utask->active_uprobe = NULL;
> utask->state = UTASK_RUNNING;
> }
> - if (uprobe) {
> - if (!(uprobe->flags & UPROBE_SKIP_SSTEP))
> + if (!(uprobe->flags & UPROBE_SKIP_SSTEP))
>
Shouldn't we check uprobe != NULL before we check the uprobe->flags ?
i.e, shouldn't the above line be :

if (uprobe && ! (uprobe->flags & UPROBE_SKIP_SSTEP)) ?
> - /*
> - * cannot singlestep; cannot skip instruction;
> - * re-execute the instruction.
> - */
> - instruction_pointer_set(regs, bp_vaddr);
> + /*
> + * cannot singlestep; cannot skip instruction;
> + * re-execute the instruction.
> + */
> + instruction_pointer_set(regs, bp_vaddr);
>
> - put_uprobe(uprobe);
> - }
> + put_uprobe(uprobe);
> }

Thanks
Suzuki



\
 
 \ /
  Last update: 2012-08-08 11:42    [W:0.375 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site