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: Fix sense of conditional to...



details:   https://anonhg.NetBSD.org/src/rev/609c84a5bf7c
branches:  trunk
changeset: 1028862:609c84a5bf7c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:13:53 2021 +0000

description:
drm: Fix sense of conditional to avoid null pointer dereference.

diffstat:

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

diffs (27 lines):

diff -r 2254cdfb60a9 -r 609c84a5bf7c sys/external/bsd/drm2/linux/linux_dma_resv.c
--- a/sys/external/bsd/drm2/linux/linux_dma_resv.c      Sun Dec 19 12:13:45 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_dma_resv.c      Sun Dec 19 12:13:53 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_dma_resv.c,v 1.8 2021/12/19 12:09:35 riastradh Exp $     */
+/*     $NetBSD: linux_dma_resv.c,v 1.9 2021/12/19 12:13:53 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_resv.c,v 1.8 2021/12/19 12:09:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_resv.c,v 1.9 2021/12/19 12:13:53 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/poll.h>
@@ -793,7 +793,7 @@
                dst_list->shared_count = 0;
                for (i = 0; i < shared_count; i++) {
                        fence = atomic_load_relaxed(&src_list->shared[i]);
-                       if ((fence = dma_fence_get_rcu(fence)) != NULL)
+                       if ((fence = dma_fence_get_rcu(fence)) == NULL)
                                goto restart;
                        if (dma_fence_is_signaled(fence)) {
                                dma_fence_put(fence);



Home | Main Index | Thread Index | Old Index