diff options
author | Russell King <rmk+lkml@arm.linux.org.uk> | 2005-03-30 16:39:42 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-30 16:39:42 -0800 |
commit | 089c43f12337dc12d1fc79ee243e3e11467ef29d (patch) | |
tree | e36bce5c4a00a43cc9367b01b6171737fc4829e9 | |
parent | f335faa05925e878eb50b822af3ea4961149bf76 (diff) | |
download | history-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.c | 8 |
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 = { |