Skip to contentSkip to conversation

drm/nouveau: Fix copy-paste error in nouveau_fence_wait_uevent_handler

PATCH In review YueHaibing 2 participants 2 messages Jan 10, 2020 – Jan 13, 2020

Subsystems (3)
lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 drm/nouveau: Fix copy-paste error in nouveau_fence_wait_uevent_handler

Like other cases, it should use rcu protected 'chan' rather than 'fence->channel' in nouveau_fence_wait_uevent_handler.

Fixes 0ec5f02f0e2c ("drm/nouveau: prevent stale fence->channel pointers, and protect with rcu")
---
 drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_fence.c +1 -1
index 9118df0..70bb6bb 100644
@@ -156,7 +156,7 @@ nouveau_fence_wait_uevent_handler(struct nvif_notify *notify)
 
 		fence = list_entry(fctx->pending.next, typeof(*fence), head);
 		chan = rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx->lock));
-		if (nouveau_fence_update(fence->channel, fctx))
+		if (nouveau_fence_update(chan, fctx))
 			ret = NVIF_NOTIFY_DROP;
 	}
 	spin_unlock_irqrestore(&fctx->lock, flags);
Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · YueHaibing

Like other cases, it should use rcu protected 'chan' rather than 'fence->channel' in nouveau_fence_wait_uevent_handler.

Fixes 0ec5f02f0e2c ("drm/nouveau: prevent stale fence->channel pointers, and protect with rcu")

Got it, thanks!

Quoted 25 lines
---
 drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_fence.c +1 -2
index 9118df0..70bb6bb 100644
@@ -156,7 +156,7 @@ nouveau_fence_wait_uevent_handler(struct nvif_notify *notify)
 
                fence = list_entry(fctx->pending.next, typeof(*fence), head);
                chan = rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx->lock));
-               if (nouveau_fence_update(fence->channel, fctx))
+               if (nouveau_fence_update(chan, fctx))
                        ret = NVIF_NOTIFY_DROP;
        }
        spin_unlock_irqrestore(&fctx->lock, flags);
--

2.7.4

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau