Skip to content

Commit

Permalink
Fix bug in crash handler register dump
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ibmzach authored and dcrowell77 committed Nov 20, 2019
1 parent d432c45 commit 60210d3
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/kernel/misc.C
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 60210d3

Please sign in to comment.