Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ian Rogers and committed by
Namhyung Kim
27e71125 492689ba

+1 -1
+1 -1
tools/perf/builtin-kvm.c
··· 2014 2014 for (j = 1; j < argc; j++, i++) 2015 2015 rec_argv[i] = STRDUP_FAIL_EXIT(argv[j]); 2016 2016 2017 - BUG_ON(i != rec_argc); 2017 + BUG_ON(i + 2 != rec_argc); 2018 2018 2019 2019 ret = kvm_add_default_arch_event(&i, rec_argv); 2020 2020 if (ret)