summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorTony Breeds2008-12-15 19:17:48 +0100
committerPaul Mackerras2008-12-21 04:21:14 +0100
commit7a2eab0d4e656341cc0f6481d722d410f0414f0b (patch)
tree12fef29982befe9469e2066b293639629e6b824a /arch/powerpc/platforms
parentpowerpc: Rename struct vm_region to avoid conflict with NOMMU (diff)
downloadkernel-qcow2-linux-7a2eab0d4e656341cc0f6481d722d410f0414f0b.tar.gz
kernel-qcow2-linux-7a2eab0d4e656341cc0f6481d722d410f0414f0b.tar.xz
kernel-qcow2-linux-7a2eab0d4e656341cc0f6481d722d410f0414f0b.zip
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: Tony Breeds <tony@bakeyournoodle.com> Acked-by: Manish Ahuja <mahujam@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/pseries/phyp_dump.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/phyp_dump.c b/arch/powerpc/platforms/pseries/phyp_dump.c
index edbc012c2ebc..16e659a71440 100644
--- a/arch/powerpc/platforms/pseries/phyp_dump.c
+++ b/arch/powerpc/platforms/pseries/phyp_dump.c
@@ -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);