[PATCH] sna: avoid negative timeouts

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

 



It's nice to avoid X server crashes (by not passing negative values to
select(3)).

For more information:
http://article.gmane.org/gmane.comp.freedesktop.xorg.devel/37388

Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 src/sna/sna_accel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 4838371..ce6da7d 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -15978,6 +15978,9 @@ void sna_accel_block_handler(struct sna *sna, struct timeval **tv)
 		     __FUNCTION__, sna->timer_active));
 
 		timeout = sna->timer_expire[0] - TIME;
+		if (timeout < 0)
+			timeout = 0;
+
 		DBG(("%s: flush timer expires in %d [%d]\n",
 		     __FUNCTION__, timeout, sna->timer_expire[0]));
 
-- 
1.8.4-fc

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux