linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] uprobes: don't put NULL pointer in uprobe_register()
@ 2012-08-30 17:26 Sebastian Andrzej Siewior
  2012-08-31 14:05 ` Oleg Nesterov
  2012-09-12 12:43 ` Srikar Dronamraju
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-08-30 17:26 UTC (permalink / raw)
  To: ananth; +Cc: x86, linux-kernel, srikar, oleg, Sebastian Andrzej Siewior

alloc_uprobe() might return a NULL pointer, put_uprobe() can't deal with
this.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] uprobes: don't put NULL pointer in uprobe_register()
  2012-08-30 17:26 [PATCH] uprobes: don't put NULL pointer in uprobe_register() Sebastian Andrzej Siewior
@ 2012-08-31 14:05 ` Oleg Nesterov
  2012-09-12 12:43 ` Srikar Dronamraju
  1 sibling, 0 replies; 3+ messages in thread
From: Oleg Nesterov @ 2012-08-31 14:05 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: ananth, x86, linux-kernel, srikar

On 08/30, Sebastian Andrzej Siewior wrote:
>
> alloc_uprobe() might return a NULL pointer, put_uprobe() can't deal with
> this.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  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);

Applied as cf54f5c8, thanks.

Oleg.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] uprobes: don't put NULL pointer in uprobe_register()
  2012-08-30 17:26 [PATCH] uprobes: don't put NULL pointer in uprobe_register() Sebastian Andrzej Siewior
  2012-08-31 14:05 ` Oleg Nesterov
@ 2012-09-12 12:43 ` Srikar Dronamraju
  1 sibling, 0 replies; 3+ messages in thread
From: Srikar Dronamraju @ 2012-09-12 12:43 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: ananth, x86, linux-kernel, oleg

* 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
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-12 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-30 17:26 [PATCH] uprobes: don't put NULL pointer in uprobe_register() Sebastian Andrzej Siewior
2012-08-31 14:05 ` Oleg Nesterov
2012-09-12 12:43 ` Srikar Dronamraju

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).