lkml.org 
[lkml]   [2012]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] uprobes: don't put NULL pointer in uprobe_register()
* Sebastian Andrzej Siewior <bigeasy@linutronix.de> [2012-08-30 19:26:22]:

> alloc_uprobe() might return a NULL pointer, put_uprobe() can't deal with
> this.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>

> ---
> kernel/events/uprobes.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> index 7b3112c..30f3e23 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -897,7 +897,8 @@ int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *
> }
>
> mutex_unlock(uprobes_hash(inode));
> - put_uprobe(uprobe);
> + if (uprobe)
> + put_uprobe(uprobe);
>
> return ret;
> }
> --
> 1.7.10.4
>



\
 
 \ /
  Last update: 2012-09-12 15:41    [W:0.066 / U:0.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site