[Mesa-dev] [PATCH] clover: fix Invalid read of size 8
Vedran Miletić
vedran at miletic.net
Tue Mar 7 23:46:46 UTC 2017
Piglit's tests/cl/custom/buffer-flags.c test in-0x0-out-0x8 subtest
reports Invalid read of size 8 when ran under Valgrind due to pipe
resource being destroyed prior to the mapping of the said resource.
This patch amends the destructor to clear the mappings first.
Signed-off-by: Vedran Miletić <vedran at miletic.net>
---
src/gallium/state_trackers/clover/core/resource.cpp | 1 +
src/gallium/state_trackers/clover/core/resource.hpp | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/state_trackers/clover/core/resource.cpp b/src/gallium/state_trackers/clover/core/resource.cpp
index 06fd3f6..a73bd28 100644
--- a/src/gallium/state_trackers/clover/core/resource.cpp
+++ b/src/gallium/state_trackers/clover/core/resource.cpp
@@ -176,6 +176,7 @@ root_resource::root_resource(clover::device &dev, memory_obj &obj,
}
root_resource::~root_resource() {
+ maps.clear();
device().pipe->resource_destroy(device().pipe, pipe);
}
diff --git a/src/gallium/state_trackers/clover/core/resource.hpp b/src/gallium/state_trackers/clover/core/resource.hpp
index 9993dcb..cb7836f 100644
--- a/src/gallium/state_trackers/clover/core/resource.hpp
+++ b/src/gallium/state_trackers/clover/core/resource.hpp
@@ -75,7 +75,6 @@ namespace clover {
pipe_resource *pipe;
vector offset;
- private:
std::list<mapping> maps;
};
--
2.9.3
More information about the mesa-dev
mailing list