Mesa (main): panfrost: fix segfault in pandecode

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Feb 28 12:49:07 UTC 2022


Module: Mesa
Branch: main
Commit: 6d0824abccbddc8b8480990ac49c542f6680c2a4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6d0824abccbddc8b8480990ac49c542f6680c2a4

Author: Adrián Larumbe <adrian.larumbe at collabora.com>
Date:   Mon Feb 28 05:47:04 2022 +0000

panfrost: fix segfault in pandecode

The structure wrapped around the rb tree node was being freed, but not the node
itself, which caused a segmentation fault when accessing its parent node.

Add rb tree node remove call to fix it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15188>

---

 src/panfrost/lib/genxml/decode_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/panfrost/lib/genxml/decode_common.c b/src/panfrost/lib/genxml/decode_common.c
index 40f32b2c935..d9ba65884ca 100644
--- a/src/panfrost/lib/genxml/decode_common.c
+++ b/src/panfrost/lib/genxml/decode_common.c
@@ -239,6 +239,7 @@ void
 pandecode_close(void)
 {
         rb_tree_foreach_safe(struct pandecode_mapped_memory, it, &mmap_tree, node) {
+                rb_tree_remove(&mmap_tree, &it->node);
                 free(it);
         }
 



More information about the mesa-commit mailing list