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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: James Lamanna <[email protected]>

Signed-off by: James Lamanna <[email protected]>
Signed-off-by: Domen Puncer <[email protected]>
Signed-off-by: Alexey Dobriyan <[email protected]>
---

 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux