mfd: fix pcap adc locking
authorDaniel Ribeiro <drwyrm@gmail.com>
Tue, 23 Jun 2009 15:30:58 +0000 (12:30 -0300)
committerSamuel Ortiz <sameol@linux.intel.com>
Fri, 3 Jul 2009 09:54:57 +0000 (11:54 +0200)
Release the lock on error.

Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/ezx-pcap.c

index 671a7efe86a8b8404ad1e31aa50959ba3167a8a5..c1de4afa89a62fc79055d0bdaa47ad2a31c2adf3 100644 (file)
@@ -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);