kernel: fatal: check if _current is NULL
Arches which have custom swap to main can have _current be NULL very, very early in the boot process. Check this to avoid an infinite loop of fatal errors. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
27739fcc43
commit
ad110d495e
1 changed files with 1 additions and 1 deletions
|
@ -48,7 +48,7 @@ __weak void k_sys_fatal_error_handler(unsigned int reason,
|
||||||
|
|
||||||
static const char *thread_name_get(struct k_thread *thread)
|
static const char *thread_name_get(struct k_thread *thread)
|
||||||
{
|
{
|
||||||
const char *thread_name = k_thread_name_get(thread);
|
const char *thread_name = thread ? k_thread_name_get(thread) : NULL;
|
||||||
|
|
||||||
if (thread_name == NULL || thread_name[0] == '\0') {
|
if (thread_name == NULL || thread_name[0] == '\0') {
|
||||||
thread_name = "unknown";
|
thread_name = "unknown";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue