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

Author: Paulo Zanoni <[email protected]>
Date:   Fri Sep  8 14:50:17 2023 -0700

iris: assert(bo->deps) after realloc()

Iris in general doesn't really like checking the return value of its
allocations, but in some places it does assert that those pointers are
non-NULL. We've recently investigated a bug that could have been
coming from a failed bo->deps realloc(), so add the assert() here to
help give us more confidence over things the next time we're debugging
issues.

Reviewed-by: José Roberto de Souza <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Signed-off-by: Paulo Zanoni <[email protected]>
(cherry picked from commit 7c538b5ad8ef7b86164080c1639d993b7d7bdfb9)

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

---

 src/gallium/drivers/iris/iris_batch.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/iris/iris_batch.c 
b/src/gallium/drivers/iris/iris_batch.c
index e2b4ec5e2aa..0b7f0aea429 100644
--- a/src/gallium/drivers/iris/iris_batch.c
+++ b/src/gallium/drivers/iris/iris_batch.c
@@ -750,6 +750,7 @@ update_bo_syncobjs(struct iris_batch *batch, struct iris_bo 
*bo, bool write)
    if (screen->id >= bo->deps_size) {
       int new_size = screen->id + 1;
       bo->deps = realloc(bo->deps, new_size * sizeof(bo->deps[0]));
+      assert(bo->deps);
       memset(&bo->deps[bo->deps_size], 0,
              sizeof(bo->deps[0]) * (new_size - bo->deps_size));
 

Reply via email to