Skip to contentSkip to conversation

MFD/PCAP: fix adc locking

PATCH Applied Daniel Ribeiro 2 participants 2 messages Jun 23, 2009 – Jul 3, 2009 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 MFD/PCAP: fix adc locking

Release the lock on error.

---
 drivers/mfd/ezx-pcap.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/mfd/ezx-pcap.c +3 -1
index 671a7ef..c1de4af 100644
@@ -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);
Signature · 4 lines
tg: (f234012..) pcap/fix-adc-locking (depends on: master)

-- 
Daniel Ribeiro
Applied
#1 lore raw
Quoted 1 line · Daniel Ribeiro

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.

Quoted 27 lines
---
 drivers/mfd/ezx-pcap.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/mfd/ezx-pcap.c +3 -1
index 671a7ef..c1de4af 100644
@@ -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);
Signature · 4 lines
tg: (f234012..) pcap/fix-adc-locking (depends on: master)

-- 
Daniel Ribeiro
Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/