Module Name:    src
Committed By:   riastradh
Date:           Sun Dec 19 12:13:53 UTC 2021

Modified Files:
        src/sys/external/bsd/drm2/linux: linux_dma_resv.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/linux/linux_dma_resv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/linux/linux_dma_resv.c
diff -u src/sys/external/bsd/drm2/linux/linux_dma_resv.c:1.8 src/sys/external/bsd/drm2/linux/linux_dma_resv.c:1.9
--- src/sys/external/bsd/drm2/linux/linux_dma_resv.c:1.8	Sun Dec 19 12:09:35 2021
+++ src/sys/external/bsd/drm2/linux/linux_dma_resv.c	Sun Dec 19 12:13:53 2021
@@ -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 @@ top:
 		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);

Reply via email to