2005-03-02 22:32 diff -lu or.c agpgart_be.c Page 1 --- or.c 2005-01-31 19:50:00.000000000 +0200 +++ agpgart_be.c 2005-03-02 22:19:25.000000000 +0200 @@ -4075,6 +4081,13 @@ } } } + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) + // the reference count has been increased in agp_backend_initialize. + if (device) + pci_dev_put(device); +#endif + /* * PASS3: Figure out the 8X/4X setting and enable the * target (our motherboard chipset). @@ -5283,6 +5296,12 @@ pci_dev_put(device); #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) + // the reference count has been increased in agp_backend_initialize. + if (device) + pci_dev_put(device); +#endif + return(0); /* success */ } @@ -7428,6 +7447,11 @@ return rc; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) + // decrease the reference count. + pci_dev_put(agp_bridge.dev); +#endif + if (agp_bridge.needs_scratch_page == TRUE) { agp_bridge.scratch_page = agp_bridge.agp_alloc_page();