提交 7a2eab0d 编写于 作者: T Tony Breeds 提交者: Paul Mackerras

powerpc: Protect against NULL pointer deref in phyp-dump code

print_dump_header() will be called at least once with a NULL pointer in
a normal boot sequence.  If DEBUG is defined then we will dereference
the pointer and crash.  Add a quick fix to exit early in the NULL pointer
case.
Signed-off-by: NTony Breeds <tony@bakeyournoodle.com>
Acked-by: NManish Ahuja <mahujam@gmail.com>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 8168b540
......@@ -130,6 +130,9 @@ static unsigned long init_dump_header(struct phyp_dump_header *ph)
static void print_dump_header(const struct phyp_dump_header *ph)
{
#ifdef DEBUG
if (ph == NULL)
return;
printk(KERN_INFO "dump header:\n");
/* setup some ph->sections required */
printk(KERN_INFO "version = %d\n", ph->version);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册