nvk/mme: Add missing nullcheck in nvk_mme_test_state_state

Needed for some FSR macro changes I want to test.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Fixes: 7d6cc15ab8 ("nvk/mme: Add a unit test framework for driver macros")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40407>
This commit is contained in:
Mary Guillemard 2026-03-10 08:55:23 +01:00 committed by Marge Bot
parent 73faef7bd3
commit 32895657b4

View file

@ -80,9 +80,11 @@ nvk_mme_test_state_state(void *_ts, uint16_t addr)
/* First, look backwards through the expected data that we've already
* written. This ensures that mthd() impacts state().
*/
for (int32_t i = ts->ei - 1; i >= 0; i--) {
if (ts->test->expected[i].mthd == addr)
return ts->test->expected[i].data;
if (ts->test->expected != NULL) {
for (int32_t i = ts->ei - 1; i >= 0; i--) {
if (ts->test->expected[i].mthd == addr)
return ts->test->expected[i].data;
}
}
/* Now look at init. We assume the init data is unique */