diff options
| -rw-r--r-- | tools/perf/util/evsel.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index c980bbff6353..1a61628a1c12 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
| @@ -251,8 +251,9 @@ struct perf_evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx) | |||
| 251 | { | 251 | { |
| 252 | struct perf_evsel *evsel = zalloc(perf_evsel__object.size); | 252 | struct perf_evsel *evsel = zalloc(perf_evsel__object.size); |
| 253 | 253 | ||
| 254 | if (evsel != NULL) | 254 | if (!evsel) |
| 255 | perf_evsel__init(evsel, attr, idx); | 255 | return NULL; |
| 256 | perf_evsel__init(evsel, attr, idx); | ||
| 256 | 257 | ||
| 257 | if (perf_evsel__is_bpf_output(evsel)) { | 258 | if (perf_evsel__is_bpf_output(evsel)) { |
| 258 | evsel->attr.sample_type |= (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | | 259 | evsel->attr.sample_type |= (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | |
