summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-09-14 22:13:29 +0000
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-14 22:13:29 +0000
commitc3f603f1ba42f82cfb30e06f08d35cf672e90147 (patch)
tree34f26f8d9d20e37d1d21385086af982a6d3fc722
parent7993da1d35df8298ca93d04dd202bca8224367af (diff)
downloadmediapointer-dvb-s2-c3f603f1ba42f82cfb30e06f08d35cf672e90147.tar.gz
mediapointer-dvb-s2-c3f603f1ba42f82cfb30e06f08d35cf672e90147.tar.bz2
Correct dangerous and inefficient msecs_to_jiffies() calculation in some V4L2 drivers
From: Andreas Mohr <andi@lisas.de> Signed-off-by: Andreas Mohr <andi@lisas.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--linux/drivers/media/video/et61x251/et61x251_core.c6
-rw-r--r--linux/drivers/media/video/sn9c102/sn9c102_core.c6
-rw-r--r--linux/drivers/media/video/zc0301/zc0301_core.c6
3 files changed, 12 insertions, 6 deletions
diff --git a/linux/drivers/media/video/et61x251/et61x251_core.c b/linux/drivers/media/video/et61x251/et61x251_core.c
index bf88a1387..fca273107 100644
--- a/linux/drivers/media/video/et61x251/et61x251_core.c
+++ b/linux/drivers/media/video/et61x251/et61x251_core.c
@@ -1383,8 +1383,10 @@ et61x251_read(struct file* filp, char __user * buf,
(!list_empty(&cam->outqueue)) ||
(cam->state & DEV_DISCONNECTED) ||
(cam->state & DEV_MISCONFIGURED),
- cam->module_param.frame_timeout *
- 1000 * msecs_to_jiffies(1) );
+ msecs_to_jiffies(
+ cam->module_param.frame_timeout * 1000
+ )
+ );
if (timeout < 0) {
mutex_unlock(&cam->fileop_mutex);
return timeout;
diff --git a/linux/drivers/media/video/sn9c102/sn9c102_core.c b/linux/drivers/media/video/sn9c102/sn9c102_core.c
index 63432ccd2..69df0cb75 100644
--- a/linux/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/linux/drivers/media/video/sn9c102/sn9c102_core.c
@@ -1958,8 +1958,10 @@ sn9c102_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
(!list_empty(&cam->outqueue)) ||
(cam->state & DEV_DISCONNECTED) ||
(cam->state & DEV_MISCONFIGURED),
- cam->module_param.frame_timeout *
- 1000 * msecs_to_jiffies(1) );
+ msecs_to_jiffies(
+ cam->module_param.frame_timeout * 1000
+ )
+ );
if (timeout < 0) {
mutex_unlock(&cam->fileop_mutex);
return timeout;
diff --git a/linux/drivers/media/video/zc0301/zc0301_core.c b/linux/drivers/media/video/zc0301/zc0301_core.c
index b6a3ac815..996cf0c41 100644
--- a/linux/drivers/media/video/zc0301/zc0301_core.c
+++ b/linux/drivers/media/video/zc0301/zc0301_core.c
@@ -823,8 +823,10 @@ zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
(!list_empty(&cam->outqueue)) ||
(cam->state & DEV_DISCONNECTED) ||
(cam->state & DEV_MISCONFIGURED),
- cam->module_param.frame_timeout *
- 1000 * msecs_to_jiffies(1) );
+ msecs_to_jiffies(
+ cam->module_param.frame_timeout * 1000
+ )
+ );
if (timeout < 0) {
mutex_unlock(&cam->fileop_mutex);
return timeout;