fix(quest): check a caught-up KGSL context at timestamp zero too

A context with no submissions skipped the ownership check. Check whenever
nothing is pending, since a pending timestamp's wait already checks it.
This commit is contained in:
Anuar Lukpanov committed 2026-11-01 11:33:03 +05:00
1 parent 6d7732710c
commit 1259abed5f
2 files changed
+10 -5

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@ static int read_retired(int (*real)(int, unsigned long, void *), int fd,
timestamp = __atomic_load_n(&contexts[id].retired, __ATOMIC_RELAXED);
submitted = __atomic_load_n(&contexts[id].submitted, __ATOMIC_RELAXED);
/* KGSL checks a context's owner on every wait, which catches one that died with a reused descriptor. */
if (timestamp != 0 && wait_retired(real, fd, id, timestamp) < 0) return -1;
if (timestamp == submitted && wait_retired(real, fd, id, timestamp) < 0) return -1;
while (timestamp != submitted) {
result = wait_retired(real, fd, id, timestamp + 1);
if (result < 0) return -1;