Module Name:    src
Committed By:   riastradh
Date:           Mon Sep  3 18:02:11 UTC 2018

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

Log Message:
Preserve signedness to return failure from fence_wait_timeout.

>From mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
    src/sys/external/bsd/drm2/linux/linux_reservation.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_reservation.c
diff -u src/sys/external/bsd/drm2/linux/linux_reservation.c:1.10 src/sys/external/bsd/drm2/linux/linux_reservation.c:1.11
--- src/sys/external/bsd/drm2/linux/linux_reservation.c:1.10	Mon Aug 27 15:28:27 2018
+++ src/sys/external/bsd/drm2/linux/linux_reservation.c	Mon Sep  3 18:02:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_reservation.c,v 1.10 2018/08/27 15:28:27 riastradh Exp $	*/
+/*	$NetBSD: linux_reservation.c,v 1.11 2018/09/03 18:02:11 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.10 2018/08/27 15:28:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.11 2018/09/03 18:02:11 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/poll.h>
@@ -711,6 +711,7 @@ reservation_object_wait_timeout_rcu(stru
 	struct reservation_object_list *list;
 	struct fence *fence;
 	uint32_t i, shared_count;
+	long ret;
 
 	if (timeout == 0)
 		return reservation_object_test_signaled_rcu(robj, shared);
@@ -792,9 +793,11 @@ wait:
 	 */
 	KASSERT(fence != NULL);
 	rcu_read_unlock();
-	timeout = fence_wait_timeout(fence, intr, timeout);
-	if (timeout <= 0)
-		return timeout;
+	ret = fence_wait_timeout(fence, intr, timeout);
+	if (ret <= 0)
+		return ret;
+	KASSERT(ret <= timeout);
+	timeout = ret;
 	goto top;
 }
 

Reply via email to