diff options
author | Andy Walls <awalls@radix.net> | 2010-01-30 22:20:27 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 21:10:50 +0300 |
commit | 6adb21c8719feef3b1629f5a9b5535e914f897ed (patch) | |
tree | 95e81f2e4b663c61609b449a277e06c65ebcfdba /drivers/media/video/cx18 | |
parent | b3b6dc620626eda13d7c1330cf3733862fe29420 (diff) | |
download | linux-6adb21c8719feef3b1629f5a9b5535e914f897ed.tar.xz |
V4L/DVB: cx18: Add missing serialization locks to cx18-dvb
Operations that manipulates the state of the encoder or global instance flags
and variables should be serialized. This adds some serialization locks that
have been missing from cx18-dvb. Since the DVB part of the CX23418 doesn't
affect the encoder, no one would likely have ever noticed a race in changing
card instance variables.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18')
-rw-r--r-- | drivers/media/video/cx18/cx18-dvb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/video/cx18/cx18-dvb.c b/drivers/media/video/cx18/cx18-dvb.c index 0ad5b63d27fe..0ae2c2e1eab5 100644 --- a/drivers/media/video/cx18/cx18-dvb.c +++ b/drivers/media/video/cx18/cx18-dvb.c @@ -260,6 +260,7 @@ static int cx18_dvb_start_feed(struct dvb_demux_feed *feed) mutex_lock(&stream->dvb.feedlock); if (stream->dvb.feeding++ == 0) { CX18_DEBUG_INFO("Starting Transport DMA\n"); + mutex_lock(&cx->serialize_lock); set_bit(CX18_F_S_STREAMING, &stream->s_flags); ret = cx18_start_v4l2_encode_stream(stream); if (ret < 0) { @@ -268,6 +269,7 @@ static int cx18_dvb_start_feed(struct dvb_demux_feed *feed) if (stream->dvb.feeding == 0) clear_bit(CX18_F_S_STREAMING, &stream->s_flags); } + mutex_unlock(&cx->serialize_lock); } else ret = 0; mutex_unlock(&stream->dvb.feedlock); @@ -291,7 +293,9 @@ static int cx18_dvb_stop_feed(struct dvb_demux_feed *feed) mutex_lock(&stream->dvb.feedlock); if (--stream->dvb.feeding == 0) { CX18_DEBUG_INFO("Stopping Transport DMA\n"); + mutex_lock(&cx->serialize_lock); ret = cx18_stop_v4l2_encode_stream(stream, 0); + mutex_unlock(&cx->serialize_lock); } else ret = 0; mutex_unlock(&stream->dvb.feedlock); |