freedreno: Fix warning about uninit size for the size==0 special case.

The size==0 query case would have just used uninitialized stack data for
sizing its BOs.

Fixes: 536ec9d7f5 ("freedreno: Refactor fd_resource_create_with_modifiers() into a helper")
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7664>
This commit is contained in:
Eric Anholt
2020-11-17 12:40:26 -08:00
committed by Marge Bot
parent 530a32bb95
commit 239bae7b94
@@ -977,6 +977,7 @@ fd_resource_allocate_and_resolve(struct pipe_screen *pscreen,
if (size == 0) {
/* note, semi-intention == instead of & */
debug_assert(prsc->bind == PIPE_BIND_QUERY_BUFFER);
*psize = 0;
return prsc;
}