]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf debug: Avoid stack overflow in recursive error message
authorIan Rogers <irogers@google.com>
Fri, 28 Feb 2025 22:22:58 +0000 (14:22 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:24 +0000 (14:39 +0200)
commit7cd1096d3bead15446433559e4419bbffa033e03
treed5bf4ae234b5d478c76328ebe38dc38a7e4a2c63
parent7a40b52d4442178bee0cf1c36bc450ab951cef0f
perf debug: Avoid stack overflow in recursive error message

[ Upstream commit bda840191d2aae3b7cadc3ac21835dcf29487191 ]

In debug_file, pr_warning_once is called on error. As that function
calls debug_file the function will yield a stack overflow. Switch the
location of the call so the recursion is avoided.

Reviewed-by: Howard Chu <howardchu95@gmail.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: https://lore.kernel.org/r/20250228222308.626803-2-irogers@google.com
Fixes: ec49230cf6dda704 ("perf debug: Expose debug file")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/util/debug.c