]> git.baikalelectronics.ru Git - kernel.git/commit
[media] dvb: use ktime_t for internal timeout
authorArnd Bergmann <arnd@arndb.de>
Fri, 17 Jun 2016 20:46:28 +0000 (17:46 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 8 Jul 2016 19:36:00 +0000 (16:36 -0300)
commit2dd0c755c3a2bbaec1a45e705773eaa9b73a5638
tree06db28644a13222eb284841f336a2854e0ca7fef
parentad1304c54c8750585d8b2794fced9d7f51b62994
[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>
drivers/media/dvb-core/demux.h
drivers/media/dvb-core/dmxdev.c
drivers/media/dvb-core/dvb_demux.c
drivers/media/dvb-core/dvb_demux.h
drivers/media/dvb-core/dvb_net.c