vc4: Fix memory leak from simple_list conversion.
authorEric Anholt <eric@anholt.net>
Thu, 18 Jun 2015 06:49:19 +0000 (23:49 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 18 Jun 2015 06:53:49 +0000 (23:53 -0700)
I accidentally shadowed the outside declaration, so we always returned
NULL even when we'd found something in the cache.

src/gallium/drivers/vc4/vc4_bufmgr.c

index eef7e9dc16fcc62ae3e2ab9767ed6119a82d5b39..cbdb9e89cf6c1669a0d48806b75028b680be475f 100644 (file)
@@ -87,9 +87,8 @@ vc4_bo_from_cache(struct vc4_screen *screen, uint32_t size, const char *name)
         struct vc4_bo *bo = NULL;
         pipe_mutex_lock(cache->lock);
         if (!list_empty(&cache->size_list[page_index])) {
-                struct vc4_bo *bo = LIST_ENTRY(struct vc4_bo,
-                                               cache->size_list[page_index].next,
-                                               size_list);
+                bo = LIST_ENTRY(struct vc4_bo, cache->size_list[page_index].next,
+                                size_list);
 
                 /* Check that the BO has gone idle.  If not, then we want to
                  * allocate something new instead, since we assume that the