Commit 2b9f9c3c authored by Dave Jones's avatar Dave Jones

[AGPGART] More failure path sanity checking.

parent 5e3ee351
...@@ -181,13 +181,16 @@ static int agp_backend_initialize(struct pci_dev *dev) ...@@ -181,13 +181,16 @@ static int agp_backend_initialize(struct pci_dev *dev)
/* cannot be __exit b/c as it could be called from __init code */ /* cannot be __exit b/c as it could be called from __init code */
static void agp_backend_cleanup(void) static void agp_backend_cleanup(void)
{ {
agp_bridge.cleanup(); if (agp_bridge.cleanup != NULL)
agp_bridge.free_gatt_table(); agp_bridge.cleanup();
vfree(agp_bridge.key_list); if (agp_bridge.free_gatt_table != NULL)
agp_bridge.free_gatt_table();
if (agp_bridge.key_list)
vfree(agp_bridge.key_list);
if (agp_bridge.needs_scratch_page == TRUE) { if ((agp_bridge.agp_destroy_page!=NULL) &&
(agp_bridge.needs_scratch_page == TRUE))
agp_bridge.agp_destroy_page(phys_to_virt(agp_bridge.scratch_page_real)); agp_bridge.agp_destroy_page(phys_to_virt(agp_bridge.scratch_page_real));
}
} }
static int agp_power(struct pm_dev *dev, pm_request_t rq, void *data) static int agp_power(struct pm_dev *dev, pm_request_t rq, void *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment