fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / char / agp / amd-k7-agp.c
index 1f77665..c85c8ca 100644 (file)
@@ -101,6 +101,11 @@ static int amd_create_gatt_pages(int nr_tables)
        for (i = 0; i < nr_tables; i++) {
                entry = kzalloc(sizeof(struct amd_page_map), GFP_KERNEL);
                if (entry == NULL) {
+                       while (i > 0) {
+                               kfree(tables[i-1]);
+                               i--;
+                       }
+                       kfree(tables);
                        retval = -ENOMEM;
                        break;
                }
@@ -118,7 +123,7 @@ static int amd_create_gatt_pages(int nr_tables)
        return retval;
 }
 
-/* Since we don't need contigious memory we just try
+/* Since we don't need contiguous memory we just try
  * to get the gatt table once
  */