Module Name:    src
Committed By:   riastradh
Date:           Tue Oct 23 03:56:48 UTC 2018

Modified Files:
        src/sys/external/bsd/drm2/include/linux: sched.h

Log Message:
Clamp timeout to INT_MAX to avoid the bad kind of integer truncation.

XXX pullup-7
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/drm2/include/linux/sched.h

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/include/linux/sched.h
diff -u src/sys/external/bsd/drm2/include/linux/sched.h:1.11 src/sys/external/bsd/drm2/include/linux/sched.h:1.12
--- src/sys/external/bsd/drm2/include/linux/sched.h:1.11	Tue Oct 23 03:56:33 2018
+++ src/sys/external/bsd/drm2/include/linux/sched.h	Tue Oct 23 03:56:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sched.h,v 1.11 2018/10/23 03:56:33 riastradh Exp $	*/
+/*	$NetBSD: sched.h,v 1.12 2018/10/23 03:56:47 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -74,8 +74,8 @@ schedule_timeout_uninterruptible(long ti
 	}
 
 	start = hardclock_ticks;
-	/* XXX Integer truncation...not likely to matter here.  */
-	(void)kpause("loonix", false /*!intr*/, timeout, NULL);
+	/* Caller is expected to loop anyway, so no harm in truncating.  */
+	(void)kpause("loonix", false /*!intr*/, MIN(timeout, INT_MAX), NULL);
 	end = hardclock_ticks;
 
 	remain = timeout - (end - start);

Reply via email to