Fix dma_fence use after free regression

From: Christian König

Date: Wed Sep 09 2026 - 09:58:39 EST


Hi everyone,

as discussed in a separate thread Jonghyuk Kim(MalHyuk) stumbled over an
use after free which we through should have already been fixed last
year.

Turned out that a recent patch regressed that by limiting the check to
the ops pointer instead of checking both ops and signaling status of a
dma_fence.

Fix this and also add a few lines of comments to drm_sched_fini() to
document the necessity of an RCU barriere after signaling the last
drm_sched_fence object.

Please review and comment,
Christian.