diff options
author | Dean Anderson <dean@sensoray.com> | 2009-04-20 19:07:44 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-29 15:41:14 -0300 |
commit | 9d63cec16829ac3600c5014d207a659df3b93c9a (patch) | |
tree | 89edc69720bba4a026ac6228b8b79ab24565f473 | |
parent | 272aa3966b3244e576c5c07bfff77ea320b89317 (diff) | |
download | linux-3.10-9d63cec16829ac3600c5014d207a659df3b93c9a.tar.gz linux-3.10-9d63cec16829ac3600c5014d207a659df3b93c9a.tar.bz2 linux-3.10-9d63cec16829ac3600c5014d207a659df3b93c9a.zip |
V4L/DVB (11570): patch: s2255drv: fix race condition on set mode
set_modeready flag must be set before command sent to USB in
s2255_write_config.
Signed-off-by: Dean Anderson <dean@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/s2255drv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c index 5202cadb2aa..30f4698be90 100644 --- a/drivers/media/video/s2255drv.c +++ b/drivers/media/video/s2255drv.c @@ -1237,6 +1237,7 @@ static int s2255_set_mode(struct s2255_dev *dev, unsigned long chn, buffer[1] = (u32) chn_rev; buffer[2] = CMD_SET_MODE; memcpy(&buffer[3], &dev->mode[chn], sizeof(struct s2255_mode)); + dev->setmode_ready[chn] = 0; res = s2255_write_config(dev->udev, (unsigned char *)buffer, 512); if (debug) dump_verify_mode(dev, mode); @@ -1245,7 +1246,6 @@ static int s2255_set_mode(struct s2255_dev *dev, unsigned long chn, /* wait at least 3 frames before continuing */ if (mode->restart) { - dev->setmode_ready[chn] = 0; wait_event_timeout(dev->wait_setmode[chn], (dev->setmode_ready[chn] != 0), msecs_to_jiffies(S2255_SETMODE_TIMEOUT)); |