All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] powerpc/eeh: Fix NULL pointer dereference during EEH event handling
@ 2026-12-05  5:33 Narayana Murty N
  0 siblings, 0 replies; only message in thread
From: Narayana Murty N @ 2026-12-05  5:33 UTC (permalink / raw)
  To: sourabhjain, maddy
  Cc: oohall, mpe, npiggin, chleroy, ritesh.list, sshegde, linuxppc-dev,
	linux-kernel

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-05  5:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05  5:33 [PATCH v1 1/1] powerpc/eeh: Fix NULL pointer dereference during EEH event handling Narayana Murty N

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.