
From: Russell King <rmk+lkml@arm.linux.org.uk>

It appears that the parport driver claims on-board superio devices without
actually doing anything.  When the driver is removed, we try to dereference
non-existent driver data to unregister the ports.  Since we didn't register
anything, it's safe to ignore these devices in the remove function.

Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/parport/parport_pc.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff -puN drivers/parport/parport_pc.c~parport-oops-fix drivers/parport/parport_pc.c
--- 25/drivers/parport/parport_pc.c~parport-oops-fix	2005-03-28 22:27:57.000000000 -0800
+++ 25-akpm/drivers/parport/parport_pc.c	2005-03-28 22:27:57.000000000 -0800
@@ -2976,10 +2976,12 @@ static void __devexit parport_pc_pci_rem
 
 	pci_set_drvdata(dev, NULL);
 
-	for (i = data->num - 1; i >= 0; i--)
-		parport_pc_unregister_port(data->ports[i]);
+	if (data) {
+		for (i = data->num - 1; i >= 0; i--)
+			parport_pc_unregister_port(data->ports[i]);
 
-	kfree(data);
+		kfree(data);
+	}
 }
 
 static struct pci_driver parport_pc_pci_driver = {
_
