]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd27f860b2a8b0f4a663790dc2901d91b44198be1
treeef2568798760887907b503689e1a727f9818d3d0
parent4fadf94fdfde8657c72aaf61957569d8b7be6bb9
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