diff options
author | Zach Clark <zach@ibm.com> | 2019-11-19 13:51:01 -0600 |
---|---|---|
committer | Daniel M Crowell <dcrowell@us.ibm.com> | 2019-11-20 12:53:21 -0600 |
commit | 60210d3ddb2a23c7628f1033c779363bf150f555 (patch) | |
tree | 7dd45f07a2f829a8367992cd0d1f71c629620765 /src/kernel | |
parent | d432c4503559abd127ebd170891a50da3ce2683d (diff) | |
download | talos-hostboot-60210d3ddb2a23c7628f1033c779363bf150f555.tar.gz talos-hostboot-60210d3ddb2a23c7628f1033c779363bf150f555.zip |
Fix bug in crash handler register dump
This commit fixes a NULL-dereference in the register dump code for the
kernel crash handler. The task pointer can be NULL, in which case we
should not attempt to dump registers.
Change-Id: I3433ca466f34827f102d64ef2aac4fffc5b49b70
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/87422
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Nicholas E Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/misc.C | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/kernel/misc.C b/src/kernel/misc.C index 0a149526d..157d9ba22 100644 --- a/src/kernel/misc.C +++ b/src/kernel/misc.C @@ -644,21 +644,22 @@ namespace KernelMisc l_frame = reinterpret_cast<uint64_t*>(*l_frame); } - printk("\n GPRs for %d:\n", l_tid); - - for (int i = 0; i < 16; ++i) + if (i_task) { - printk(" r%-2d = 0x%016lx r%-2d = 0x%016lx\n", - i, - i_task->context.gprs[i], - i + 16, - i_task->context.gprs[i + 16]); + printk("\n GPRs for %d:\n", l_tid); + + for (int i = 0; i < 16; ++i) + { + printk(" r%-2d = 0x%016lx r%-2d = 0x%016lx\n", + i, + i_task->context.gprs[i], + i + 16, + i_task->context.gprs[i + 16]); + } } printk("\n"); } - - }; namespace KernelMemState |