Commit 0de4b34d authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Ingo Molnar

tracing/kprobe: Fix NULL pointer deref check

Add NULL check for avoiding NULL pointer deref.
This bug has been introduced by:

  1ff511e3: tracing/kprobes: Add bitfield type

which causes a null pointer dereference bug when kprobe-tracer
parses an argument without type.
Reported-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: 2nddept-manager@sdl.hitachi.co.jp
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20110214054807.8919.69740.stgit@ltc236.sdl.hitachi.co.jp>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Reported-by: default avatarArnaldo Carvalho de Melo <acme@ghostprotocols.net>
parent 40262a71
...@@ -935,7 +935,7 @@ static int parse_probe_arg(char *arg, struct trace_probe *tp, ...@@ -935,7 +935,7 @@ static int parse_probe_arg(char *arg, struct trace_probe *tp,
parg->offset = tp->size; parg->offset = tp->size;
tp->size += parg->type->size; tp->size += parg->type->size;
ret = __parse_probe_arg(arg, parg->type, &parg->fetch, is_return); ret = __parse_probe_arg(arg, parg->type, &parg->fetch, is_return);
if (ret >= 0) if (ret >= 0 && t != NULL)
ret = __parse_bitfield_probe_arg(t, parg->type, &parg->fetch); ret = __parse_bitfield_probe_arg(t, parg->type, &parg->fetch);
if (ret >= 0) { if (ret >= 0) {
parg->fetch_size.fn = get_fetch_size_function(parg->type, parg->fetch_size.fn = get_fetch_size_function(parg->type,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment