intel/perf: fix crash when no perf queries are supported

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ec1fa1d51f ("intel/perf: fix raw query kernel metric selection")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7024>
This commit is contained in:
Lionel Landwerlin
2020-10-06 11:38:54 +03:00
committed by Marge Bot
parent 82563b6a9f
commit 79f3544412

View File

@@ -781,7 +781,7 @@ load_oa_metrics(struct gen_perf_config *perf, int fd,
break;
}
}
if (perf->fallback_raw_oa_metric == 0)
if (perf->fallback_raw_oa_metric == 0 && perf->n_queries > 0)
perf->fallback_raw_oa_metric = perf->queries[perf->n_queries - 1].oa_metrics_set_id;
}