public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/2] [media] rc: unlock on error in show_protocols()
@ 2012-11-27 17:35 Dan Carpenter
  2012-11-27 19:51 ` Douglas Bagnall
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-11-27 17:35 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Douglas Bagnall, David Härdeman, Jarod Wilson,
	Ezequiel Garcia, linux-media, kernel-janitors

We recently introduced a new return -ENODEV in this function but we need
to unlock before returning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 601d1ac1..d593bc6 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -789,8 +789,10 @@ static ssize_t show_protocols(struct device *device,
 	} else if (dev->raw) {
 		enabled = dev->raw->enabled_protocols;
 		allowed = ir_raw_get_allowed_protocols();
-	} else
+	} else {
+		mutex_unlock(&dev->lock);
 		return -ENODEV;
+	}
 
 	IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n",
 		   (long long)allowed,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch 1/2] [media] rc: unlock on error in show_protocols()
  2012-11-27 17:35 [patch 1/2] [media] rc: unlock on error in show_protocols() Dan Carpenter
@ 2012-11-27 19:51 ` Douglas Bagnall
  0 siblings, 0 replies; 2+ messages in thread
From: Douglas Bagnall @ 2012-11-27 19:51 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Mauro Carvalho Chehab, David Härdeman, Jarod Wilson,
	Ezequiel Garcia, linux-media, kernel-janitors

On 28/11/12 06:35, Dan Carpenter wrote:
> We recently introduced a new return -ENODEV in this function but we need
> to unlock before returning.

There is an identical patch here (scroll down):
https://patchwork.kernel.org/patch/1284081/

I'm not sure what happened to it.

Douglas

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
> index 601d1ac1..d593bc6 100644
> --- a/drivers/media/rc/rc-main.c
> +++ b/drivers/media/rc/rc-main.c
> @@ -789,8 +789,10 @@ static ssize_t show_protocols(struct device *device,
>  	} else if (dev->raw) {
>  		enabled = dev->raw->enabled_protocols;
>  		allowed = ir_raw_get_allowed_protocols();
> -	} else
> +	} else {
> +		mutex_unlock(&dev->lock);
>  		return -ENODEV;
> +	}
>  
>  	IR_dprintk(1, "allowed - 0x%llx, enabled - 0x%llx\n",
>  		   (long long)allowed,
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-27 20:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-27 17:35 [patch 1/2] [media] rc: unlock on error in show_protocols() Dan Carpenter
2012-11-27 19:51 ` Douglas Bagnall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox