All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Ezequiel Garcia <elezegarcia@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] [media] stk1160: unlock on error path stk1160_set_alternate()
Date: Wed, 15 Aug 2012 21:53:35 +0000	[thread overview]
Message-ID: <502C1A5F.7050308@redhat.com> (raw)
In-Reply-To: <CALF0-+WGaYErM5SrCGfOJFCS0yqjJ2Oa4+u3_GcHAXR3mwnBmQ@mail.gmail.com>

Em 14-08-2012 07:51, Ezequiel Garcia escreveu:
> Hi Dan,
> 
> On Tue, Aug 14, 2012 at 3:59 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>> There are some unlocks missing on error.
>>
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>> ---
>> Applies on top of linux-next.
>>
>> diff --git a/drivers/media/video/stk1160/stk1160-v4l.c b/drivers/media/video/stk1160/stk1160-v4l.c
>> index 360bdbe..1ad4ac1 100644
>> --- a/drivers/media/video/stk1160/stk1160-v4l.c
>> +++ b/drivers/media/video/stk1160/stk1160-v4l.c
>> @@ -159,8 +159,9 @@ static bool stk1160_set_alternate(struct stk1160 *dev)
>>
>>  static int stk1160_start_streaming(struct stk1160 *dev)
>>  {
>> -       int i, rc;
>>         bool new_pkt_size;
>> +       int rc = 0;
>> +       int i;
>>
>>         /* Check device presence */
>>         if (!dev->udev)
>> @@ -183,7 +184,7 @@ static int stk1160_start_streaming(struct stk1160 *dev)
>>         if (!dev->isoc_ctl.num_bufs || new_pkt_size) {
>>                 rc = stk1160_alloc_isoc(dev);
>>                 if (rc < 0)
>> -                       return rc;
>> +                       goto out_unlock;
>>         }
>>
>>         /* submit urbs and enables IRQ */
>> @@ -192,7 +193,7 @@ static int stk1160_start_streaming(struct stk1160 *dev)
>>                 if (rc) {
>>                         stk1160_err("cannot submit urb[%d] (%d)\n", i, rc);
>>                         stk1160_uninit_isoc(dev);
>> -                       return rc;
>> +                       goto out_unlock;
>>                 }
>>         }
>>
>> @@ -205,9 +206,10 @@ static int stk1160_start_streaming(struct stk1160 *dev)
>>
>>         stk1160_dbg("streaming started\n");
>>
>> +out_unlock:
>>         mutex_unlock(&dev->v4l_lock);
>>
>> -       return 0;
>> +       return rc;
>>  }
>>
>>  /* Must be called with v4l_lock hold */
> 
> This and the other stk1160 patch looks good. I'll give them a test.

Ok, I'll merge them both, with your ack.

> 
> Thanks,
> Ezequiel.
> --
> 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
> 


WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Ezequiel Garcia <elezegarcia@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] [media] stk1160: unlock on error path stk1160_set_alternate()
Date: Wed, 15 Aug 2012 18:53:35 -0300	[thread overview]
Message-ID: <502C1A5F.7050308@redhat.com> (raw)
In-Reply-To: <CALF0-+WGaYErM5SrCGfOJFCS0yqjJ2Oa4+u3_GcHAXR3mwnBmQ@mail.gmail.com>

Em 14-08-2012 07:51, Ezequiel Garcia escreveu:
> Hi Dan,
> 
> On Tue, Aug 14, 2012 at 3:59 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>> There are some unlocks missing on error.
>>
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>> ---
>> Applies on top of linux-next.
>>
>> diff --git a/drivers/media/video/stk1160/stk1160-v4l.c b/drivers/media/video/stk1160/stk1160-v4l.c
>> index 360bdbe..1ad4ac1 100644
>> --- a/drivers/media/video/stk1160/stk1160-v4l.c
>> +++ b/drivers/media/video/stk1160/stk1160-v4l.c
>> @@ -159,8 +159,9 @@ static bool stk1160_set_alternate(struct stk1160 *dev)
>>
>>  static int stk1160_start_streaming(struct stk1160 *dev)
>>  {
>> -       int i, rc;
>>         bool new_pkt_size;
>> +       int rc = 0;
>> +       int i;
>>
>>         /* Check device presence */
>>         if (!dev->udev)
>> @@ -183,7 +184,7 @@ static int stk1160_start_streaming(struct stk1160 *dev)
>>         if (!dev->isoc_ctl.num_bufs || new_pkt_size) {
>>                 rc = stk1160_alloc_isoc(dev);
>>                 if (rc < 0)
>> -                       return rc;
>> +                       goto out_unlock;
>>         }
>>
>>         /* submit urbs and enables IRQ */
>> @@ -192,7 +193,7 @@ static int stk1160_start_streaming(struct stk1160 *dev)
>>                 if (rc) {
>>                         stk1160_err("cannot submit urb[%d] (%d)\n", i, rc);
>>                         stk1160_uninit_isoc(dev);
>> -                       return rc;
>> +                       goto out_unlock;
>>                 }
>>         }
>>
>> @@ -205,9 +206,10 @@ static int stk1160_start_streaming(struct stk1160 *dev)
>>
>>         stk1160_dbg("streaming started\n");
>>
>> +out_unlock:
>>         mutex_unlock(&dev->v4l_lock);
>>
>> -       return 0;
>> +       return rc;
>>  }
>>
>>  /* Must be called with v4l_lock hold */
> 
> This and the other stk1160 patch looks good. I'll give them a test.

Ok, I'll merge them both, with your ack.

> 
> Thanks,
> Ezequiel.
> --
> 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
> 


  reply	other threads:[~2012-08-15 21:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14  6:59 [patch] [media] stk1160: unlock on error path stk1160_set_alternate() Dan Carpenter
2012-08-14  6:59 ` Dan Carpenter
2012-08-14 10:51 ` Ezequiel Garcia
2012-08-14 10:51   ` Ezequiel Garcia
2012-08-15 21:53   ` Mauro Carvalho Chehab [this message]
2012-08-15 21:53     ` Mauro Carvalho Chehab
2012-08-15 22:02     ` Ezequiel Garcia
2012-08-15 22:02       ` Ezequiel Garcia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=502C1A5F.7050308@redhat.com \
    --to=mchehab@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=elezegarcia@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.