[PATCH] fix pci_get_device conversion in intel-agp

From: Christoph Hellwig
Date: Sat Jan 08 2005 - 14:09:28 EST


- any device teardown must happen between agp_remove_bridge and
agp_put_bridge, before agp_remove_bridge users can still call into
the code
- it's releasing a reference to the wrong device


--- 1.76/drivers/char/agp/intel-agp.c 2004-12-22 05:53:58 +01:00
+++ edited/drivers/char/agp/intel-agp.c 2005-01-08 20:11:38 +01:00
@@ -1720,8 +1720,13 @@
{
struct agp_bridge_data *bridge = pci_get_drvdata(pdev);

- pci_dev_put(pdev);
agp_remove_bridge(bridge);
+
+ if (intel_i810_private.i810_dev)
+ pci_dev_put(intel_i810_private.i830_dev);
+ if (intel_i810_private.i830_dev)
+ pci_dev_put(intel_i830_private.i830_dev);
+
agp_put_bridge(bridge);
}
--- 1.18/drivers/char/agp/intel-mch-agp.c 2004-12-16 07:31:44 +01:00
+++ edited/drivers/char/agp/intel-mch-agp.c 2005-01-08 20:12:18 +01:00
@@ -569,8 +569,11 @@
{
struct agp_bridge_data *bridge = pci_get_drvdata(pdev);

- pci_dev_put(pdev);
agp_remove_bridge(bridge);
+
+ if (intel_i810_private.i830_dev)
+ pci_dev_put(intel_i830_private.i830_dev);
+
agp_put_bridge(bridge);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/