]> git.baikalelectronics.ru Git - kernel.git/commit
tools lib traceevent: Handle NULL comm name
authorJosef Bacik <jbacik@fb.com>
Tue, 24 Mar 2015 13:57:49 +0000 (09:57 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 24 Mar 2015 15:10:26 +0000 (12:10 -0300)
commit605beecb668d92f4212297cfe8981541dc3941f5
tree131825bb2a4620b0d06341cca9934c5603244c60
parent4422003ff977c00b3918bcc9d35ad5b8cb38c60e
tools lib traceevent: Handle NULL comm name

It is possible that a pid has no associated comm attached to it, although it
can still be passed to pevent_register_comm().

But if comm is NULL, it will cause strdup() to segfault. To prevent this
from happening, if comm is NULL use the default "<...>" name for the
pid.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20150324135922.549965495@goodmis.org
Link: http://lkml.kernel.org/p/1403799732-30308-1-git-send-email-jbacik@fb.com
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/traceevent/event-parse.c