linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix pci_get_device conversion in intel-agp
@ 2005-01-08 19:08 Christoph Hellwig
  2005-01-08 19:13 ` Roland Dreier
  2005-01-09 18:29 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Hellwig @ 2005-01-08 19:08 UTC (permalink / raw)
  To: davej, hannal; +Cc: linux-kernel

 - 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);
 }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-01-09 18:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-08 19:08 [PATCH] fix pci_get_device conversion in intel-agp Christoph Hellwig
2005-01-08 19:13 ` Roland Dreier
2005-01-08 19:14   ` Christoph Hellwig
2005-01-09 18:29 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).