summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-core/dvb_demux.h
diff options
context:
space:
mode:
authorArnd Bergmann2016-06-17 22:46:28 +0200
committerMauro Carvalho Chehab2016-07-08 21:36:00 +0200
commite95be15886ac9a931f540073c1c0db299e806f3c (patch)
tree06db28644a13222eb284841f336a2854e0ca7fef /drivers/media/dvb-core/dvb_demux.h
parent[media] media: coda: Fix probe() if reset controller is missing (diff)
downloadkernel-qcow2-linux-e95be15886ac9a931f540073c1c0db299e806f3c.tar.gz
kernel-qcow2-linux-e95be15886ac9a931f540073c1c0db299e806f3c.tar.xz
kernel-qcow2-linux-e95be15886ac9a931f540073c1c0db299e806f3c.zip
[media] dvb: use ktime_t for internal timeout
The dvb demuxer code uses a 'struct timespec' to pass a timeout as absolute time. This will cause problems on 32-bit architectures in 2038 when time_t overflows, and it is racy with a concurrent settimeofday() call. This patch changes the code to use ktime_get() instead, using the monotonic time base to avoid both the race and the overflow. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/dvb-core/dvb_demux.h')
-rw-r--r--drivers/media/dvb-core/dvb_demux.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/dvb-core/dvb_demux.h b/drivers/media/dvb-core/dvb_demux.h
index ae7fc33c3231..5ed3cab4ad28 100644
--- a/drivers/media/dvb-core/dvb_demux.h
+++ b/drivers/media/dvb-core/dvb_demux.h
@@ -83,7 +83,7 @@ struct dvb_demux_feed {
u8 *buffer;
int buffer_size;
- struct timespec timeout;
+ ktime_t timeout;
struct dvb_demux_filter *filter;
int ts_type;
@@ -134,7 +134,7 @@ struct dvb_demux {
uint8_t *cnt_storage; /* for TS continuity check */
- struct timespec speed_last_time; /* for TS speed check */
+ ktime_t speed_last_time; /* for TS speed check */
uint32_t speed_pkts_cnt; /* for TS speed check */
};