* [patch] [media] stk1160: unlock on error path stk1160_set_alternate()
@ 2012-08-14 6:59 Dan Carpenter
2012-08-14 10:51 ` Ezequiel Garcia
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2012-08-14 6:59 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: Ezequiel Garcia, linux-media, kernel-janitors
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 */
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch] [media] stk1160: unlock on error path stk1160_set_alternate()
2012-08-14 6:59 [patch] [media] stk1160: unlock on error path stk1160_set_alternate() Dan Carpenter
@ 2012-08-14 10:51 ` Ezequiel Garcia
2012-08-15 21:53 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 4+ messages in thread
From: Ezequiel Garcia @ 2012-08-14 10:51 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Mauro Carvalho Chehab, linux-media, kernel-janitors
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.
Thanks,
Ezequiel.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] [media] stk1160: unlock on error path stk1160_set_alternate()
2012-08-14 10:51 ` Ezequiel Garcia
@ 2012-08-15 21:53 ` Mauro Carvalho Chehab
2012-08-15 22:02 ` Ezequiel Garcia
0 siblings, 1 reply; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2012-08-15 21:53 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: Dan Carpenter, Mauro Carvalho Chehab, linux-media,
kernel-janitors
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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] [media] stk1160: unlock on error path stk1160_set_alternate()
2012-08-15 21:53 ` Mauro Carvalho Chehab
@ 2012-08-15 22:02 ` Ezequiel Garcia
0 siblings, 0 replies; 4+ messages in thread
From: Ezequiel Garcia @ 2012-08-15 22:02 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Dan Carpenter, Mauro Carvalho Chehab, linux-media,
kernel-janitors
On Wed, Aug 15, 2012 at 6:53 PM, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:
> 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.
That's fine.
Thanks,
Ezequiel.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-15 22:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-14 6:59 [patch] [media] stk1160: unlock on error path stk1160_set_alternate() Dan Carpenter
2012-08-14 10:51 ` Ezequiel Garcia
2012-08-15 21:53 ` Mauro Carvalho Chehab
2012-08-15 22:02 ` Ezequiel Garcia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).