@@ -151,11 +151,12 @@ static void init_copy(struct video_data *video, bool index)
static bool get_frame(struct front_face *front, int *need_init)
{
struct videobuf_buffer *vb = front->curr_frame;
+ unsigned long flags;
if (vb)
return true;
- spin_lock(&front->queue_lock);
+ spin_lock_irqsave(&front->queue_lock, flags);
if (!list_empty(&front->active)) {
vb = list_entry(front->active.next,
struct videobuf_buffer, queue);
@@ -164,7 +165,7 @@ static bool get_frame(struct front_face *front, int *need_init)
front->curr_frame = vb;
list_del_init(&vb->queue);
}
- spin_unlock(&front->queue_lock);
+ spin_unlock_irqrestore(&front->queue_lock, flags);
return !!vb;
}
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Cc: linux-media@vger.kernel.org Signed-off-by: Ming Lei <ming.lei@canonical.com> --- drivers/media/usb/tlg2300/pd-video.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)