Skip to content

Commit 27e7112

Browse files
captain5050namhyung
authored andcommitted
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: 45ff39f ("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>
1 parent 492689b commit 27e7112

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/perf/builtin-kvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ static int __cmd_record(const char *file_name, int argc, const char **argv)
20142014
for (j = 1; j < argc; j++, i++)
20152015
rec_argv[i] = STRDUP_FAIL_EXIT(argv[j]);
20162016

2017-
BUG_ON(i != rec_argc);
2017+
BUG_ON(i + 2 != rec_argc);
20182018

20192019
ret = kvm_add_default_arch_event(&i, rec_argv);
20202020
if (ret)

0 commit comments

Comments
 (0)