[PATCH] agp: backend: vfree() checking cleanup From: James Lamanna Signed-off by: James Lamanna Signed-off-by: Domen Puncer Signed-off-by: Alexey Dobriyan Index: linux-kj/drivers/char/agp/backend.c =================================================================== --- linux-kj.orig/drivers/char/agp/backend.c 2005-10-11 18:36:46.000000000 +0400 +++ linux-kj/drivers/char/agp/backend.c 2005-10-11 18:37:08.000000000 +0400 @@ -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; }