summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2022-03-17 11:57:07 +0200
committerEric Engestrom <eric@engestrom.ch>2022-03-18 20:00:46 +0000
commit2e048268e5ac7d0005f612a2dc1e3cabd9f29dcc (patch)
tree966628a38936b439ed8e7358cfef26a85ca9649b /src
parent9b71ebf574d9cc09b18c5f4a389ff471208c0286 (diff)
anv: zero-out anv_batch_bo
anv_batch_bo has a length field that we use to flush cachelines. Not having that field initialized properly leads us to access out of bound memory. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: mesa-stable Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15425> (cherry picked from commit d68b9f0e6b1e45533c9f53eca6111cabb34d6fdb)
Diffstat (limited to 'src')
-rw-r--r--src/intel/vulkan/anv_batch_chain.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index 350b9952019..d96bf0165d3 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -346,7 +346,7 @@ anv_batch_bo_create(struct anv_cmd_buffer *cmd_buffer,
{
VkResult result;
- struct anv_batch_bo *bbo = vk_alloc(&cmd_buffer->pool->alloc, sizeof(*bbo),
+ struct anv_batch_bo *bbo = vk_zalloc(&cmd_buffer->pool->alloc, sizeof(*bbo),
8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (bbo == NULL)
return vk_error(cmd_buffer, VK_ERROR_OUT_OF_HOST_MEMORY);