Skip to content

Commit

Permalink
[AGPGART] Intel-agp adjustments
Browse files Browse the repository at this point in the history
Fix a call to __free_page where __free_pages(, 2) was meant, and do proper
error path handling. Also remove a redundant conditional.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Dave Jones <davej@redhat.com>
  • Loading branch information
Jan Beulich authored and Dave Jones committed Apr 26, 2007
1 parent 9eeee24 commit 89cf7cc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/char/agp/intel-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ static void *i8xx_alloc_pages(void)
return NULL;

if (change_page_attr(page, 4, PAGE_KERNEL_NOCACHE) < 0) {
change_page_attr(page, 4, PAGE_KERNEL);
global_flush_tlb();
__free_page(page);
__free_pages(page, 2);
return NULL;
}
global_flush_tlb();
Expand All @@ -209,7 +210,7 @@ static void i8xx_destroy_pages(void *addr)
global_flush_tlb();
put_page(page);
unlock_page(page);
free_pages((unsigned long)addr, 2);
__free_pages(page, 2);
atomic_dec(&agp_bridge->current_memory_agp);
}

Expand Down Expand Up @@ -315,9 +316,6 @@ static struct agp_memory *alloc_agpphysmem_i8xx(size_t pg_count, int type)
struct agp_memory *new;
void *addr;

if (pg_count != 1 && pg_count != 4)
return NULL;

switch (pg_count) {
case 1: addr = agp_bridge->driver->agp_alloc_page(agp_bridge);
global_flush_tlb();
Expand Down

0 comments on commit 89cf7cc

Please sign in to comment.