diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 503f5a65e0cc..8b213482e564 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1923,7 +1923,8 @@ int machine__process_fork_event(struct machine *machine, union perf_event *event * (fork) event that would have removed the thread was lost. Assume the * latter case and continue on as best we can. */ - if (thread__pid(parent) != (pid_t)event->fork.ppid) { + if (parent != NULL && + thread__pid(parent) != (pid_t)event->fork.ppid) { dump_printf("removing erroneous parent thread %d/%d\n", thread__pid(parent), thread__tid(parent)); machine__remove_thread(machine, parent);