From 35185ad9df8efa84981607cec3dd495c875a534b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 21 Feb 2024 11:10:10 -0500 Subject: [PATCH] zink: assert that batch_id is valid in zink_screen_check_last_finished() 0 is never a valid batch_id cc: mesa-stable Part-of: --- src/gallium/drivers/zink/zink_screen.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/zink/zink_screen.h b/src/gallium/drivers/zink/zink_screen.h index 886700b65ad..c907bc6e85d 100644 --- a/src/gallium/drivers/zink/zink_screen.h +++ b/src/gallium/drivers/zink/zink_screen.h @@ -61,6 +61,7 @@ static inline bool zink_screen_check_last_finished(struct zink_screen *screen, uint32_t batch_id) { const uint32_t check_id = (uint32_t)batch_id; + assert(check_id); /* last_finished may have wrapped */ if (screen->last_finished < UINT_MAX / 2) { /* last_finished has wrapped, batch_id has not */