From 089c43f12337dc12d1fc79ee243e3e11467ef29d Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 30 Mar 2005 16:39:42 -0800 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/parport/parport_pc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 2951b9084bfd2..c5774e7855d03 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 = { -- cgit 1.2.3-korg