V4L/DVB (13003): Correct dangerous and inefficient msecs_to_jiffies() calculation in some V4L2 drivers

Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Andreas Mohr 2009-09-14 19:13:29 -03:00 committed by Mauro Carvalho Chehab
parent 6c119ff493
commit 607cfab6e7
3 changed files with 12 additions and 6 deletions

View File

@ -1379,8 +1379,10 @@ et61x251_read(struct file* filp, char __user * buf,
(!list_empty(&cam->outqueue)) || (!list_empty(&cam->outqueue)) ||
(cam->state & DEV_DISCONNECTED) || (cam->state & DEV_DISCONNECTED) ||
(cam->state & DEV_MISCONFIGURED), (cam->state & DEV_MISCONFIGURED),
cam->module_param.frame_timeout * msecs_to_jiffies(
1000 * msecs_to_jiffies(1) ); cam->module_param.frame_timeout * 1000
)
);
if (timeout < 0) { if (timeout < 0) {
mutex_unlock(&cam->fileop_mutex); mutex_unlock(&cam->fileop_mutex);
return timeout; return timeout;

View File

@ -1954,8 +1954,10 @@ sn9c102_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
(!list_empty(&cam->outqueue)) || (!list_empty(&cam->outqueue)) ||
(cam->state & DEV_DISCONNECTED) || (cam->state & DEV_DISCONNECTED) ||
(cam->state & DEV_MISCONFIGURED), (cam->state & DEV_MISCONFIGURED),
cam->module_param.frame_timeout * msecs_to_jiffies(
1000 * msecs_to_jiffies(1) ); cam->module_param.frame_timeout * 1000
)
);
if (timeout < 0) { if (timeout < 0) {
mutex_unlock(&cam->fileop_mutex); mutex_unlock(&cam->fileop_mutex);
return timeout; return timeout;

View File

@ -819,8 +819,10 @@ zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
(!list_empty(&cam->outqueue)) || (!list_empty(&cam->outqueue)) ||
(cam->state & DEV_DISCONNECTED) || (cam->state & DEV_DISCONNECTED) ||
(cam->state & DEV_MISCONFIGURED), (cam->state & DEV_MISCONFIGURED),
cam->module_param.frame_timeout * msecs_to_jiffies(
1000 * msecs_to_jiffies(1) ); cam->module_param.frame_timeout * 1000
)
);
if (timeout < 0) { if (timeout < 0) {
mutex_unlock(&cam->fileop_mutex); mutex_unlock(&cam->fileop_mutex);
return timeout; return timeout;