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 <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25236>
This commit is contained in:
Paulo Zanoni 2023-09-08 14:50:17 -07:00 committed by Marge Bot
parent 3cec15dd14
commit 7c538b5ad8

View File

@ -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));