mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
perf debug: Avoid stack overflow in recursive error message
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: ec49230cf6 ("perf debug: Expose debug file")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
b10f74308e
commit
bda840191d
|
|
@ -46,8 +46,8 @@ int debug_type_profile;
|
|||
FILE *debug_file(void)
|
||||
{
|
||||
if (!_debug_file) {
|
||||
pr_warning_once("debug_file not set");
|
||||
debug_set_file(stderr);
|
||||
pr_warning_once("debug_file not set");
|
||||
}
|
||||
return _debug_file;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user