diff mbox

[media] davinci: vpif: missing unlocks on error

Message ID 20140611073108.GE16443@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter June 11, 2014, 7:31 a.m. UTC
We recently changed some locking around so we need some new unlocks on
the error paths.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Please review this one carefully.  I don't know if the unlock should go
before or after the list_for_each_entry_safe() loop.

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Lad, Prabhakar June 11, 2014, 9:44 a.m. UTC | #1
Hi Dan,

Thanks for the patch.

On Wed, Jun 11, 2014 at 8:31 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> We recently changed some locking around so we need some new unlocks on
> the error paths.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Please review this one carefully.  I don't know if the unlock should go
> before or after the list_for_each_entry_safe() loop.
>
Yes the unlock should go after the list_for_each_entry_safe() loop
please respin another version fixing it.

Thanks,
--Prabhakar Lad

> diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
> index a7ed164..2c08fbd 100644
> --- a/drivers/media/platform/davinci/vpif_capture.c
> +++ b/drivers/media/platform/davinci/vpif_capture.c
> @@ -265,6 +265,8 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
>         return 0;
>
>  err:
> +       spin_unlock_irqrestore(&common->irqlock, flags);
> +
>         list_for_each_entry_safe(buf, tmp, &common->dma_queue, list) {
>                 list_del(&buf->list);
>                 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
> diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
> index 5bb085b..b7b2bdf 100644
> --- a/drivers/media/platform/davinci/vpif_display.c
> +++ b/drivers/media/platform/davinci/vpif_display.c
> @@ -229,6 +229,8 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
>         return 0;
>
>  err:
> +       spin_unlock_irqrestore(&common->irqlock, flags);
> +
>         list_for_each_entry_safe(buf, tmp, &common->dma_queue, list) {
>                 list_del(&buf->list);
>                 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index a7ed164..2c08fbd 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -265,6 +265,8 @@  static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
 	return 0;
 
 err:
+	spin_unlock_irqrestore(&common->irqlock, flags);
+
 	list_for_each_entry_safe(buf, tmp, &common->dma_queue, list) {
 		list_del(&buf->list);
 		vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index 5bb085b..b7b2bdf 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -229,6 +229,8 @@  static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
 	return 0;
 
 err:
+	spin_unlock_irqrestore(&common->irqlock, flags);
+
 	list_for_each_entry_safe(buf, tmp, &common->dma_queue, list) {
 		list_del(&buf->list);
 		vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);