Skip to content

Commit 60210d3

Browse files
ibmzachdcrowell77
authored andcommitted
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>
1 parent d432c45 commit 60210d3

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/kernel/misc.C

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -644,21 +644,22 @@ namespace KernelMisc
644644
l_frame = reinterpret_cast<uint64_t*>(*l_frame);
645645
}
646646

647-
printk("\n GPRs for %d:\n", l_tid);
648-
649-
for (int i = 0; i < 16; ++i)
647+
if (i_task)
650648
{
651-
printk(" r%-2d = 0x%016lx r%-2d = 0x%016lx\n",
652-
i,
653-
i_task->context.gprs[i],
654-
i + 16,
655-
i_task->context.gprs[i + 16]);
649+
printk("\n GPRs for %d:\n", l_tid);
650+
651+
for (int i = 0; i < 16; ++i)
652+
{
653+
printk(" r%-2d = 0x%016lx r%-2d = 0x%016lx\n",
654+
i,
655+
i_task->context.gprs[i],
656+
i + 16,
657+
i_task->context.gprs[i + 16]);
658+
}
656659
}
657660

658661
printk("\n");
659662
}
660-
661-
662663
};
663664

664665
namespace KernelMemState

0 commit comments

Comments
 (0)