[PATCH v1 1/1] powerpc/eeh: Fix NULL pointer dereference during EEH event handling

From: Narayana Murty N

Date: Sat Dec 05 2026 - 00:33:41 EST


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@xxxxxxxxxxxxx>
---
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