]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/media/video/cx18/cx18-dvb.c
V4L/DVB: cx18: Add missing serialization locks to cx18-dvb
[net-next-2.6.git] / drivers / media / video / cx18 / cx18-dvb.c
index 0ad5b63d27fe5f1e28a29fb53535672fff69bf31..0ae2c2e1eab540127317b404979a30217e0cc483 100644 (file)
@@ -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);