public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH -mm] bugfix: release old_p's insn_slot before error return
       [not found] <200811190741.mAJ7fvK5019964@imap1.linux-foundation.org>
@ 2008-11-19 23:03 ` Masami Hiramatsu
  0 siblings, 0 replies; only message in thread
From: Masami Hiramatsu @ 2008-11-19 23:03 UTC (permalink / raw)
  To: akpm
  Cc: mm-commits, ananth, anil.s.keshavamurthy, Jim Keniston, LKML,
	systemtap-ml

Hi Andrew,

akpm@linux-foundation.org wrote:
> The patch titled
>      bugfix: pass aggr_kprobe to arch_remove_kprobe
> has been added to the -mm tree.  Its filename is
>      kprobes-support-probing-module-__exit-function-fix-2.patch

Oops, sorry, I found one another bug...

Release old_p->ainsn.insn_slot before error return, if the memory
allocation of new aggr_kprobe is failed.

Signed-off-by: Masami Hiramatsu  <mhiramat@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
---
 kernel/kprobes.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: 2.6.28-rc4/kernel/kprobes.c
===================================================================
--- 2.6.28-rc4.orig/kernel/kprobes.c
+++ 2.6.28-rc4/kernel/kprobes.c
@@ -584,8 +584,11 @@ static int __kprobes register_aggr_kprob
 		ap = old_p;
 	} else {
 		ap = kzalloc(sizeof(struct kprobe), GFP_KERNEL);
-		if (!ap)
+		if (!ap) {
+			if (kprobe_gone(old_p))
+				arch_remove_kprobe(old_p);
 			return -ENOMEM;
+		}
 		add_aggr_kprobe(ap, old_p);
 		copy_kprobe(ap, p);
 		ret = add_new_kprobe(ap, p);


-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-19 23:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200811190741.mAJ7fvK5019964@imap1.linux-foundation.org>
2008-11-19 23:03 ` [PATCH -mm] bugfix: release old_p's insn_slot before error return Masami Hiramatsu

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 read-only IMAP folder(s) and NNTP newsgroup(s).