diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2009-08-05 19:06:31 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-08-13 19:39:11 -0400 |
commit | 2dd54a54c19d0e5b50f4e1c591653772ead9d4a1 (patch) | |
tree | 3ab873ae09a4cc3f56906dbb4712e1331a078519 /drivers/media/video/pxa_camera.c | |
parent | 7d2e2e35fb50f381c9398e481aac1e1729765ae3 (diff) |
V4L/DVB (12424): soc-camera: fix recursive locking in .buf_queue()
The .buf_queue() V4L2 driver method is called under
spinlock_irqsave(q->irqlock,...), don't take the lock again inside the
function.
Reported-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pxa_camera.c')
-rw-r--r-- | drivers/media/video/pxa_camera.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index e048d25798cc..016bb45ba0c3 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c | |||
@@ -612,6 +612,7 @@ static void pxa_camera_stop_capture(struct pxa_camera_dev *pcdev) | |||
612 | dev_dbg(pcdev->soc_host.dev, "%s\n", __func__); | 612 | dev_dbg(pcdev->soc_host.dev, "%s\n", __func__); |
613 | } | 613 | } |
614 | 614 | ||
615 | /* Called under spinlock_irqsave(&pcdev->lock, ...) */ | ||
615 | static void pxa_videobuf_queue(struct videobuf_queue *vq, | 616 | static void pxa_videobuf_queue(struct videobuf_queue *vq, |
616 | struct videobuf_buffer *vb) | 617 | struct videobuf_buffer *vb) |
617 | { | 618 | { |
@@ -619,13 +620,10 @@ static void pxa_videobuf_queue(struct videobuf_queue *vq, | |||
619 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 620 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); |
620 | struct pxa_camera_dev *pcdev = ici->priv; | 621 | struct pxa_camera_dev *pcdev = ici->priv; |
621 | struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb); | 622 | struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb); |
622 | unsigned long flags; | ||
623 | 623 | ||
624 | dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d active=%p\n", __func__, | 624 | dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d active=%p\n", __func__, |
625 | vb, vb->baddr, vb->bsize, pcdev->active); | 625 | vb, vb->baddr, vb->bsize, pcdev->active); |
626 | 626 | ||
627 | spin_lock_irqsave(&pcdev->lock, flags); | ||
628 | |||
629 | list_add_tail(&vb->queue, &pcdev->capture); | 627 | list_add_tail(&vb->queue, &pcdev->capture); |
630 | 628 | ||
631 | vb->state = VIDEOBUF_ACTIVE; | 629 | vb->state = VIDEOBUF_ACTIVE; |
@@ -633,8 +631,6 @@ static void pxa_videobuf_queue(struct videobuf_queue *vq, | |||
633 | 631 | ||
634 | if (!pcdev->active) | 632 | if (!pcdev->active) |
635 | pxa_camera_start_capture(pcdev); | 633 | pxa_camera_start_capture(pcdev); |
636 | |||
637 | spin_unlock_irqrestore(&pcdev->lock, flags); | ||
638 | } | 634 | } |
639 | 635 | ||
640 | static void pxa_videobuf_release(struct videobuf_queue *vq, | 636 | static void pxa_videobuf_release(struct videobuf_queue *vq, |