Mesa (staging/22.0): tc: CPU storage needs to be freed with align_free

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 9 18:32:56 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: 0a400c9d18dc926faab70b086207443171adfba6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a400c9d18dc926faab70b086207443171adfba6

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Mon Feb  7 19:03:04 2022 -0800

tc: CPU storage needs to be freed with align_free

Cc: mesa-stable
Acked-by: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Reviewed-by: Sil Vilerino <sivileri at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>
(cherry picked from commit 7ec0e2b89351e6e56cb112e00e6c68c6bbc6faea)

---

 .pick_status.json                               | 2 +-
 src/gallium/auxiliary/util/u_threaded_context.h | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 4134a1495e0..4d5404e1536 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -427,7 +427,7 @@
         "description": "tc: CPU storage needs to be freed with align_free",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/auxiliary/util/u_threaded_context.h b/src/gallium/auxiliary/util/u_threaded_context.h
index ed375558ce8..20bc533503f 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.h
+++ b/src/gallium/auxiliary/util/u_threaded_context.h
@@ -199,6 +199,7 @@
 #include "pipe/p_state.h"
 #include "util/bitset.h"
 #include "util/u_inlines.h"
+#include "util/u_memory.h"
 #include "util/u_queue.h"
 #include "util/u_range.h"
 #include "util/u_thread.h"
@@ -609,7 +610,7 @@ tc_buffer_disable_cpu_storage(struct pipe_resource *buf)
    struct threaded_resource *tres = threaded_resource(buf);
 
    if (tres->cpu_storage) {
-      free(tres->cpu_storage);
+      align_free(tres->cpu_storage);
       tres->cpu_storage = NULL;
    }
 }



More information about the mesa-commit mailing list