2009-06-23 15:32:54

by Daniel Ribeiro

[permalink] [raw]
Subject: [PATCH 1/4] MFD/PCAP: fix adc locking

Release the lock on error.

Signed-off-by: Daniel Ribeiro <[email protected]>

---
drivers/mfd/ezx-pcap.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c
index 671a7ef..c1de4af 100644
--- a/drivers/mfd/ezx-pcap.c
+++ b/drivers/mfd/ezx-pcap.c
@@ -238,8 +238,10 @@ static irqreturn_t pcap_adc_irq(int irq, void *_pcap)
mutex_lock(&pcap->adc_mutex);
req = pcap->adc_queue[pcap->adc_head];

- if (WARN(!req, KERN_WARNING "adc irq without pending request\n"))
+ if (WARN(!req, KERN_WARNING "adc irq without pending request\n")) {
+ mutex_unlock(&pcap->adc_mutex);
return IRQ_HANDLED;
+ }

/* read requested channels results */
ezx_pcap_read(pcap, PCAP_REG_ADC, &tmp);
--
tg: (f234012..) pcap/fix-adc-locking (depends on: master)

--
Daniel Ribeiro


Attachments:
signature.asc (197.00 B)
Esta ? uma parte de mensagem assinada digitalmente

2009-07-03 10:50:45

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH 1/4] MFD/PCAP: fix adc locking

On Tue, Jun 23, 2009 at 12:30:58PM -0300, Daniel Ribeiro wrote:
> Release the lock on error.
Applied this one to my for-linus branch, which means I send a pull request to
Linus soon.
The 3 other patches are on my for-next branch.

Cheers,
Samuel.


> Signed-off-by: Daniel Ribeiro <[email protected]>
>
> ---
> drivers/mfd/ezx-pcap.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c
> index 671a7ef..c1de4af 100644
> --- a/drivers/mfd/ezx-pcap.c
> +++ b/drivers/mfd/ezx-pcap.c
> @@ -238,8 +238,10 @@ static irqreturn_t pcap_adc_irq(int irq, void *_pcap)
> mutex_lock(&pcap->adc_mutex);
> req = pcap->adc_queue[pcap->adc_head];
>
> - if (WARN(!req, KERN_WARNING "adc irq without pending request\n"))
> + if (WARN(!req, KERN_WARNING "adc irq without pending request\n")) {
> + mutex_unlock(&pcap->adc_mutex);
> return IRQ_HANDLED;
> + }
>
> /* read requested channels results */
> ezx_pcap_read(pcap, PCAP_REG_ADC, &tmp);
> --
> tg: (f234012..) pcap/fix-adc-locking (depends on: master)
>
> --
> Daniel Ribeiro



--
Intel Open Source Technology Centre
http://oss.intel.com/