diff options
| author | Ian Rogers <irogers@google.com> | 2025-11-22 00:19:13 -0800 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2025-12-03 11:07:19 -0800 |
| commit | 27e711257902475097dea3f79cbdf241fe37ec00 (patch) | |
| tree | 1cf355afedde93420fa475fdd34e252b71002670 | |
| parent | 492689ba72d0391e2c263b159a17beeea7b130a8 (diff) | |
perf kvm: Fix debug assertion
There are 2 slots left for kvm_add_default_arch_event, fix the
assertion so that debug builds don't fail the assert and to agree with
the comment.
Fixes: 45ff39f6e70aa55d0 ("perf tools kvm: Fix the potential out of range memory access issue")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
| -rw-r--r-- | tools/perf/builtin-kvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index f0f285763f19..c61369d54dd9 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c @@ -2014,7 +2014,7 @@ static int __cmd_record(const char *file_name, int argc, const char **argv) for (j = 1; j < argc; j++, i++) rec_argv[i] = STRDUP_FAIL_EXIT(argv[j]); - BUG_ON(i != rec_argc); + BUG_ON(i + 2 != rec_argc); ret = kvm_add_default_arch_event(&i, rec_argv); if (ret) |
