perf test: Fix variable length array undefined behavior in bp_account
authorIan Rogers <irogers@google.com>
Fri, 10 Jun 2022 18:02:47 +0000 (11:02 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sun, 19 Jun 2022 13:41:43 +0000 (10:41 -0300)
commitcc2145526c9889e3dbddc210c21bc3a080b2a29f
treeef2568798760887907b503689e1a727f9818d3d0
parent94725994cfd768b9ee1bd06f15c252694b1e9b89
perf test: Fix variable length array undefined behavior in bp_account

Fix:

  tests/bp_account.c:154:9: runtime error: variable length array bound evaluates to non-positive value 0

by switching from a variable length to an allocated array.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20220610180247.444798-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/bp_account.c