linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Protect against NULL pointer deref in phyp-dump code.
@ 2008-12-16  4:17 Tony Breeds
  2008-12-16 22:18 ` Manish Ahuja
  0 siblings, 1 reply; 2+ messages in thread
From: Tony Breeds @ 2008-12-16  4:17 UTC (permalink / raw)
  To: Paul Mackerras, Benjamin Herrenschmidt, Manish Ahuja; +Cc: LinuxPPC-dev

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 get a deref,
add a quick fix to exit early in the NULL pointer case.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
 arch/powerpc/platforms/pseries/phyp_dump.c |    3 +++
 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 edbc012..16e659a 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);
-- 
1.6.0.4


Yours Tony

  linux.conf.au    http://www.marchsouth.org/
  Jan 19 - 24 2009 The Australian Linux Technical Conference!

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-16 22:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-16  4:17 [PATCH] Protect against NULL pointer deref in phyp-dump code Tony Breeds
2008-12-16 22:18 ` Manish Ahuja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).