summaryrefslogtreecommitdiff
path: root/scripts/lib/kdoc/kdoc_re.py
diff options
context:
space:
mode:
authorhupu <hupu.gm@gmail.com>2025-09-10 11:16:55 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-12 14:01:02 +0300
commit86b306f3a7faf5d25aa40d799627968c7831c32f (patch)
tree2125e46fe67d23b27b5d810363e7330241103334 /scripts/lib/kdoc/kdoc_re.py
parentc5c7e0543accfefb5e8cc6c693cf6cc9e699ba4a (diff)
downloadlinux-86b306f3a7faf5d25aa40d799627968c7831c32f.tar.xz
perf subcmd: avoid crash in exclude_cmds when excludes is empty
[ Upstream commit a5edf3550f4260504b7e0ab3d40d13ffe924b773 ] When cross-compiling the perf tool for ARM64, `perf help` may crash with the following assertion failure: help.c:122: exclude_cmds: Assertion `cmds->names[ci] == NULL' failed. This happens when the perf binary is not named exactly "perf" or when multiple "perf-*" binaries exist in the same directory. In such cases, the `excludes` command list can be empty, which leads to the final assertion in exclude_cmds() being triggered. Add a simple guard at the beginning of exclude_cmds() to return early if excludes->cnt is zero, preventing the crash. Signed-off-by: hupu <hupu.gm@gmail.com> Reported-by: Guilherme Amadio <amadio@gentoo.org> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20250909094953.106706-1-amadio@gentoo.org Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_re.py')
0 files changed, 0 insertions, 0 deletions