aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/eeh_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/eeh_sysfs.c')
-rw-r--r--arch/powerpc/kernel/eeh_sysfs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/eeh_sysfs.c b/arch/powerpc/kernel/eeh_sysfs.c
index e7ae3484918c..61e2a1452131 100644
--- a/arch/powerpc/kernel/eeh_sysfs.c
+++ b/arch/powerpc/kernel/eeh_sysfs.c
@@ -68,6 +68,13 @@ void eeh_sysfs_add_device(struct pci_dev *pdev)
void eeh_sysfs_remove_device(struct pci_dev *pdev)
{
+ /*
+ * The parent directory might have been removed. We needn't
+ * continue for that case.
+ */
+ if (!pdev->dev.kobj.sd)
+ return;
+
device_remove_file(&pdev->dev, &dev_attr_eeh_mode);
device_remove_file(&pdev->dev, &dev_attr_eeh_config_addr);
device_remove_file(&pdev->dev, &dev_attr_eeh_pe_config_addr);