[PATCH 5.15 32/57] libperf evlist: Avoid out-of-bounds access