summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/s390-sample-raw.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/util/s390-sample-raw.c b/tools/perf/util/s390-sample-raw.c
index 29a744eeb71e..53383e97ec9d 100644
--- a/tools/perf/util/s390-sample-raw.c
+++ b/tools/perf/util/s390-sample-raw.c
@@ -51,8 +51,6 @@ static bool s390_cpumcfdg_testctr(struct perf_sample *sample)
struct cf_trailer_entry *te;
struct cf_ctrset_entry *cep, ce;
- if (!len)
- return false;
while (offset < len) {
cep = (struct cf_ctrset_entry *)(buf + offset);
ce.def = be16_to_cpu(cep->def);
@@ -234,10 +232,9 @@ struct pai_data { /* Event number and value */
*/
static bool s390_pai_all_test(struct perf_sample *sample)
{
- unsigned char *buf = sample->raw_data;
size_t len = sample->raw_size;
- if (len < 0xa || !buf)
+ if (len < 0xa)
return false;
return true;
}
@@ -299,6 +296,10 @@ void evlist__s390_sample_raw(struct evlist *evlist, union perf_event *event,
if (!evsel)
return;
+ /* Check for raw data in sample */
+ if (!sample->raw_size || !sample->raw_data)
+ return;
+
/* Display raw data on screen */
if (evsel->core.attr.config == PERF_EVENT_CPUM_CF_DIAG) {
if (!evsel->pmu)