Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/linux drm: Ensure the fence callback i...



details:   https://anonhg.NetBSD.org/src/rev/beb55c1ef4e5
branches:  trunk
changeset: 1028827:beb55c1ef4e5
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:09:19 2021 +0000

description:
drm: Ensure the fence callback is initialized on failure.

diffstat:

 sys/external/bsd/drm2/linux/linux_dma_fence.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r f84a0fae5fa7 -r beb55c1ef4e5 sys/external/bsd/drm2/linux/linux_dma_fence.c
--- a/sys/external/bsd/drm2/linux/linux_dma_fence.c     Sun Dec 19 12:09:09 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_dma_fence.c     Sun Dec 19 12:09:19 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_dma_fence.c,v 1.20 2021/12/19 12:07:38 riastradh Exp $   */
+/*     $NetBSD: linux_dma_fence.c,v 1.21 2021/12/19 12:09:19 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence.c,v 1.20 2021/12/19 12:07:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence.c,v 1.21 2021/12/19 12:09:19 riastradh Exp $");
 
 #include <sys/atomic.h>
 #include <sys/condvar.h>
@@ -413,10 +413,15 @@
        fcb->func = fn;
        TAILQ_INSERT_TAIL(&fence->f_callbacks, fcb, fcb_entry);
        fcb->fcb_onqueue = true;
+       ret = 0;
 
        /* Release the lock and we're done.  */
 out1:  spin_unlock(fence->lock);
-out0:  return ret;
+out0:  if (ret) {
+               fcb->func = NULL;
+               fcb->fcb_onqueue = false;
+       }
+       return ret;
 }
 
 /*



Home | Main Index | Thread Index | Old Index