aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+lkml@arm.linux.org.uk>2005-03-30 16:39:42 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-30 16:39:42 -0800
commit089c43f12337dc12d1fc79ee243e3e11467ef29d (patch)
treee36bce5c4a00a43cc9367b01b6171737fc4829e9
parentf335faa05925e878eb50b822af3ea4961149bf76 (diff)
downloadhistory-089c43f12337dc12d1fc79ee243e3e11467ef29d.tar.gz
[PATCH] paport oops fix
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> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/parport/parport_pc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 2951b9084bfd2b..c5774e7855d036 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2976,10 +2976,12 @@ static void __devexit parport_pc_pci_remove(struct pci_dev *dev)
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 = {