]> git.baikalelectronics.ru Git - kernel.git/commit
trace_kprobes: Fix a memory leak bug and check kstrdup() return value
authorMasami Hiramatsu <mhiramat@redhat.com>
Tue, 1 Dec 2009 00:19:20 +0000 (19:19 -0500)
committerIngo Molnar <mingo@elte.hu>
Tue, 1 Dec 2009 07:19:59 +0000 (08:19 +0100)
commitba8665d7dd95eb6093ee06f8f624b6acb1e73206
tree8f5f92a2bb5c115a6d69b9d552804cea7027a60f
parent5cbd08056142dcb2aea0dca7261afcb810a63c55
trace_kprobes: Fix a memory leak bug and check kstrdup() return value

Fix a memory leak case in create_trace_probe(). When an argument
is too long (> MAX_ARGSTR_LEN), it just jumps to error path. In
that case tp->args[i].name is not released.
This also fixes a bug to check kstrdup()'s return value.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frank Ch. Eigler <fche@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jason Baron <jbaron@redhat.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091201001919.10235.56455.stgit@harusame>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/trace_kprobe.c