diff --git a/Kernel/Syscalls/profiling.cpp b/Kernel/Syscalls/profiling.cpp index d49516c4fd..10a11a9dd6 100644 --- a/Kernel/Syscalls/profiling.cpp +++ b/Kernel/Syscalls/profiling.cpp @@ -60,8 +60,10 @@ int Process::sys$profiling_disable(pid_t pid) // We explicitly unlock here because we can't hold the lock when writing the coredump VFS lock.unlock(); - auto coredump = CoreDump::create(*process, String::formatted("/tmp/profiler_coredumps/{}", pid)); - coredump->write(); + if (auto coredump = CoreDump::create(*process, String::formatted("/tmp/profiler_coredumps/{}", pid))) + coredump->write(); + else + dbgln("Unable to create profiler coredump for PID {}", pid); return 0; }