All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: benh@kernel.crashing.org, mikey@neuling.org,
	michael@ellerman.id.au, miltonm@bga.com
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH 1/3] powerpc: kdump: Fix NULL pointer dereference in irq disable code
Date: Tue, 11 May 2010 12:23:29 +1000	[thread overview]
Message-ID: <20100511022329.GE12203@kryten> (raw)


With sparse irqs we have to check if we have a descriptor before dereferencing
it.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index 6f4613d..5182439 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -375,6 +375,9 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
 	for_each_irq(i) {
 		struct irq_desc *desc = irq_to_desc(i);
 
+		if (!desc)
+			continue;
+
 		if (desc->status & IRQ_INPROGRESS)
 			desc->chip->eoi(i);
 

             reply	other threads:[~2010-05-11  2:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11  2:23 Anton Blanchard [this message]
2010-05-11  2:25 ` [PATCH 2/3] powerpc: kdump: CPUs assume the context of the oopsing CPU Anton Blanchard
2010-05-11  2:27   ` [PATCH 3/3] powerpc: kdump: Use chip->shutdown to disable IRQs Anton Blanchard
2010-05-11  4:11     ` Michael Ellerman
2010-05-11  4:14   ` [PATCH 2/3] powerpc: kdump: CPUs assume the context of the oopsing CPU Michael Ellerman
2010-05-11  4:14 ` [PATCH 1/3] powerpc: kdump: Fix NULL pointer dereference in irq disable code Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100511022329.GE12203@kryten \
    --to=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=michael@ellerman.id.au \
    --cc=mikey@neuling.org \
    --cc=miltonm@bga.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.