summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-core/dmxdev.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-06-17 17:46:28 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-08 16:36:00 -0300
commite95be15886ac9a931f540073c1c0db299e806f3c (patch)
tree06db28644a13222eb284841f336a2854e0ca7fef /drivers/media/dvb-core/dmxdev.c
parent84345a23fa102100a13ff12f57d6aa09eb9359bc (diff)
[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/dmxdev.c')
-rw-r--r--drivers/media/dvb-core/dmxdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index a168cbe1c998..7b67e1dd97fd 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -556,7 +556,7 @@ static int dvb_dmxdev_start_feed(struct dmxdev *dmxdev,
struct dmxdev_filter *filter,
struct dmxdev_feed *feed)
{
- struct timespec timeout = { 0 };
+ ktime_t timeout = ktime_set(0, 0);
struct dmx_pes_filter_params *para = &filter->params.pes;
dmx_output_t otype;
int ret;