summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/eeh_driver.c
diff options
context:
space:
mode:
authorSam Bobroff <sbobroff@linux.ibm.com>2018-09-12 03:23:21 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2018-10-13 13:21:25 +0200
commitbcbe3730531239abd45ab6c6af4a18078b37dd47 (patch)
treef52e4a7cd0c3035c7628e779917390cfdd55bff3 /arch/powerpc/kernel/eeh_driver.c
parentpowerpc/eeh: Fix possible null deref in eeh_dump_dev_log() (diff)
downloadlinux-bcbe3730531239abd45ab6c6af4a18078b37dd47.tar.xz
linux-bcbe3730531239abd45ab6c6af4a18078b37dd47.zip
powerpc/eeh: Fix null deref for devices removed during EEH
If a device is removed during EEH processing (either by a driver's handler or as part of recovery), it can lead to a null dereference in eeh_pe_report_edev(). To handle this, skip devices that have been removed. Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/eeh_driver.c')
-rw-r--r--arch/powerpc/kernel/eeh_driver.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index 67619b4b3f96..4115d353c349 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -281,6 +281,10 @@ static void eeh_pe_report_edev(struct eeh_dev *edev, eeh_report_fn fn,
struct pci_driver *driver;
enum pci_ers_result new_result;
+ if (!edev->pdev) {
+ eeh_edev_info(edev, "no device");
+ return;
+ }
device_lock(&edev->pdev->dev);
if (eeh_edev_actionable(edev)) {
driver = eeh_pcid_get(edev->pdev);