Index: dist/drm/nouveau/nouveau_fence.c =================================================================== RCS file: /cvsroot/src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c,v retrieving revision 1.12 diff -p -u -r1.12 nouveau_fence.c --- dist/drm/nouveau/nouveau_fence.c 27 Aug 2018 07:37:07 -0000 1.12 +++ dist/drm/nouveau/nouveau_fence.c 28 Aug 2018 20:56:10 -0000 @@ -106,7 +106,6 @@ nouveau_fence_context_del(struct nouveau nvif_notify_put(&fctx->notify); } spin_unlock_irq(&fctx->lock); - spin_lock_destroy(&fctx->lock); nvif_notify_fini(&fctx->notify); fctx->dead = 1; @@ -121,7 +120,11 @@ nouveau_fence_context_del(struct nouveau static void nouveau_fence_context_put(struct kref *fence_ref) { - kfree(container_of(fence_ref, struct nouveau_fence_chan, fence_ref)); + struct nouveau_fence_chan *fctx = + container_of(fence_ref, struct nouveau_fence_chan, fence_ref); + + spin_lock_destroy(&fctx->lock); + kfree(fctx); } void