[PATCH] i915: Fix an overflow in __i915_wait_request

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

 



The timeout is 64bit but the maths against it is done 32bit wrapped. Force
64bit.

Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/i915_gem.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index de57e7f..dc81045 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1358,9 +1358,9 @@ out:
 		 * bit of mismatch in the jiffies<->nsecs<->ktime loop. So patch
 		 * things up to make the test happy. We allow up to 1 jiffy.
 		 *
-		 * This is a regrssion from the timespec->ktime conversion.
+		 * This is a regression from the timespec->ktime conversion.
 		 */
-		if (ret == -ETIME && *timeout < jiffies_to_usecs(1)*1000)
+		if (ret == -ETIME && *timeout < jiffies_to_usecs(1)*1000ULL)
 			*timeout = 0;
 	}
 

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux