mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 20:57:35 +00:00
Kernel: Avoid null dereference in sys$profiling_disable()
If we can't create a profiling coredump object, we shouldn't try to call write() on it.
This commit is contained in:
parent
be0816507a
commit
4befc2c282
1 changed files with 4 additions and 2 deletions
|
@ -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
|
// We explicitly unlock here because we can't hold the lock when writing the coredump VFS
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
|
|
||||||
auto coredump = CoreDump::create(*process, String::formatted("/tmp/profiler_coredumps/{}", pid));
|
if (auto coredump = CoreDump::create(*process, String::formatted("/tmp/profiler_coredumps/{}", pid)))
|
||||||
coredump->write();
|
coredump->write();
|
||||||
|
else
|
||||||
|
dbgln("Unable to create profiler coredump for PID {}", pid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue