From 0f28940fea3d65db04a12795ba997cde2826a9ef Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Fri, 8 Sep 2023 14:50:17 -0700 Subject: [PATCH] iris: assert(bo->deps) after realloc() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Kenneth Graunke Signed-off-by: Paulo Zanoni (cherry picked from commit 7c538b5ad8ef7b86164080c1639d993b7d7bdfb9) Part-of: --- 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));