perf intel-pt: Fix missing error codes processing auxtrace_info
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 23 Sep 2016 14:38:43 +0000 (17:38 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 29 Sep 2016 14:17:04 +0000 (11:17 -0300)
Fix 2 places where the err variable was not being set.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-12-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/intel-pt.c

index 77fbf02c8e41ed87f08cfb641fb4866031b98199..96519e801e5301be47b8e71e1c50eb9a9bba42ac 100644 (file)
@@ -2138,11 +2138,13 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
                pt->switch_evsel = intel_pt_find_sched_switch(session->evlist);
                if (!pt->switch_evsel) {
                        pr_err("%s: missing sched_switch event\n", __func__);
+                       err = -EINVAL;
                        goto err_delete_thread;
                }
        } else if (pt->have_sched_switch == 2 &&
                   !intel_pt_find_switch(session->evlist)) {
                pr_err("%s: missing context_switch attribute flag\n", __func__);
+               err = -EINVAL;
                goto err_delete_thread;
        }