From: Narayana Murty N <nnmlinux@linux.ibm.com>
To: sourabhjain@linux.ibm.com, maddy@linux.ibm.com
Cc: oohall@gmail.com, mpe@ellerman.id.au, npiggin@gmail.com,
chleroy@kernel.org, ritesh.list@gmail.com, sshegde@linux.ibm.com,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH v1 1/1] powerpc/eeh: Fix NULL pointer dereference during EEH event handling
Date: Sat, 5 Dec 2026 11:03:03 +0530 [thread overview]
Message-ID: <20261205053302.59009-2-nnmlinux@linux.ibm.com> (raw)
During EEH event handling, eeh_pe_report_edev() may be invoked
with a NULL result pointer when the caller does not expect a
PCI error recovery result.
If the associated PCI device is no longer available, the error
path unconditionally dereferences the result pointer to set
PCI_ERS_RESULT_DISCONNECT. This results in a NULL pointer
dereference, causing the kernel to crash during EEH recovery.
Signed-off-by: Narayana Murty N <nnmlinux@linux.ibm.com>
---
arch/powerpc/kernel/eeh_driver.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index d64cce17a4e0..0e183214f1ab 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -262,7 +262,8 @@ static void eeh_pe_report_edev(struct eeh_dev *edev, eeh_report_fn fn,
get_device(&pdev->dev);
if (!pdev) {
eeh_edev_info(edev, "no device");
- *result = PCI_ERS_RESULT_DISCONNECT;
+ if (result)
+ *result = PCI_ERS_RESULT_DISCONNECT;
return;
}
device_lock(&pdev->dev);
--
2.54.0
reply other threads:[~2026-12-05 5:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261205053302.59009-2-nnmlinux@linux.ibm.com \
--to=nnmlinux@linux.ibm.com \
--cc=chleroy@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=oohall@gmail.com \
--cc=ritesh.list@gmail.com \
--cc=sourabhjain@linux.ibm.com \
--cc=sshegde@linux.ibm.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.