freedreno/drm: Avoid unitialized timestamp in submit fail

Saw a flood of "waiting on invalid fence" with a completely bogus
looking fence # in a log of a rather strange low-memory crash.  Not
sure if it is coming from memory corruption in userspace, but if a
submit ioctl is failing due to failed allocation (or other reason)
we would get left with random stack garbage as the fence #.  Let's
not have that as a potential problem.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9638>
This commit is contained in:
Rob Clark 2021-03-16 15:45:38 -07:00 committed by Marge Bot
parent 5bc100eb2d
commit 5d2c9fd161

View File

@ -653,7 +653,7 @@ render_sysmem(struct fd_batch *batch)
static void
flush_ring(struct fd_batch *batch)
{
uint32_t timestamp;
uint32_t timestamp = 0;
int out_fence_fd = -1;
if (FD_DBG(NOHW))