aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2012-01-25 10:51:05 -0500
committerDave Airlie <airlied@redhat.com>2012-01-26 13:36:48 -0500
commit590dfe2f3bbbbeee806ee91bef68ba2a6afc16d2 (patch)
tree133e0085397d104d5a4bad8cd8afed3df6f17138 /drivers/char
parentc8fe74ae9a7285767cda1a053cfe806d67f77227 (diff)
agp: fix scratch page cleanup
In error cleanup of agp_backend_initialize() and in agp_backend_cleanup(), agp_destroy_page() is passed virtual address of the scratch page. This leads to a kernel warning if the initialization fails (or upon regular cleanup) as pointer to struct page should be passed instead. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/agp/backend.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index 4b71647782d0..317c28ce8328 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -194,10 +194,10 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
194 194
195err_out: 195err_out:
196 if (bridge->driver->needs_scratch_page) { 196 if (bridge->driver->needs_scratch_page) {
197 void *va = page_address(bridge->scratch_page_page); 197 struct page *page = bridge->scratch_page_page;
198 198
199 bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_UNMAP); 199 bridge->driver->agp_destroy_page(page, AGP_PAGE_DESTROY_UNMAP);
200 bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_FREE); 200 bridge->driver->agp_destroy_page(page, AGP_PAGE_DESTROY_FREE);
201 } 201 }
202 if (got_gatt) 202 if (got_gatt)
203 bridge->driver->free_gatt_table(bridge); 203 bridge->driver->free_gatt_table(bridge);
@@ -221,10 +221,10 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge)
221 221
222 if (bridge->driver->agp_destroy_page && 222 if (bridge->driver->agp_destroy_page &&
223 bridge->driver->needs_scratch_page) { 223 bridge->driver->needs_scratch_page) {
224 void *va = page_address(bridge->scratch_page_page); 224 struct page *page = bridge->scratch_page_page;
225 225
226 bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_UNMAP); 226 bridge->driver->agp_destroy_page(page, AGP_PAGE_DESTROY_UNMAP);
227 bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_FREE); 227 bridge->driver->agp_destroy_page(page, AGP_PAGE_DESTROY_FREE);
228 } 228 }
229} 229}
230 230