[PATCH] agp: backend: vfree() checking cleanup

From: Alexey Dobriyan
Date: Thu Sep 15 2005 - 14:27:37 EST


From: James Lamanna <jlamanna@xxxxxxxxx>

Signed-off by: James Lamanna <jlamanna@xxxxxxxxx>
Signed-off-by: Domen Puncer <domen@xxxxxxxxxxxx>
Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
---

drivers/char/agp/backend.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)

--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -135,7 +135,7 @@ static int agp_find_max(void)

static int agp_backend_initialize(struct agp_bridge_data *bridge)
{
- int size_value, rc, got_gatt=0, got_keylist=0;
+ int size_value, rc, got_gatt=0;

bridge->max_memory_agp = agp_find_max();
bridge->version = &agp_current_version;
@@ -173,7 +173,6 @@ static int agp_backend_initialize(struct
rc = -ENOMEM;
goto err_out;
}
- got_keylist = 1;

/* FIXME vmalloc'd memory not guaranteed contiguous */
memset(bridge->key_list, 0, PAGE_SIZE * 4);
@@ -192,10 +191,8 @@ err_out:
gart_to_virt(bridge->scratch_page_real));
if (got_gatt)
bridge->driver->free_gatt_table(bridge);
- if (got_keylist) {
- vfree(bridge->key_list);
- bridge->key_list = NULL;
- }
+ vfree(bridge->key_list);
+ bridge->key_list = NULL;
return rc;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/