Skip to contentSkip to conversation

ARM: samsung: adc: fix race in s3c_adc_start

PATCH New Todd Poynor 3 participants 5 messages Jul 12, 2012 – Jul 13, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: samsung: adc: fix race in s3c_adc_start

Checking for adc->ts_pend already claimed should be done with the lock held.

Change-Id Ic9f15e26bd19934ab8c2885ce5df265933ac304a
---
 arch/arm/plat-samsung/adc.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
arch/arm/plat-samsung/adc.c +5 -3
index 33ecd0c..b1e05cc 100644
@@ -157,11 +157,13 @@ int s3c_adc_start(struct s3c_adc_client *client,
 		return -EINVAL;
 	}
 
-	if (client->is_ts && adc->ts_pend)
-		return -EAGAIN;
-
 	spin_lock_irqsave(&adc->lock, flags);
 
+	if (client->is_ts && adc->ts_pend) {
+		spin_unlock_irqrestore(&adc->lock, flags);
+		return -EAGAIN;
+	}
+
 	client->channel = channel;
 	client->nr_samples = nr_samples;
 
Signature · 1 line
1.7.7.3
#2 lore raw

PATCH 1/1 ARM: samsung: adc: fix race in s3c_adc_start

Quoted 7 lines · Ben Dooks
Quoted 5 lines · Todd Poynor

Checking for adc->ts_pend already claimed should be done with the lock held.

Change-Id Ic9f15e26bd19934ab8c2885ce5df265933ac304a

Ben, thanks for your ack, will apply.

BTW, Todd, do you want to keep the 'Change-Id' in mainline? If you don't mind, I'd like to remove it...

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#3 lore raw

PATCH 1/1 ARM: samsung: adc: fix race in s3c_adc_start

Quoted 2 lines · Kukjin Kim

BTW, Todd, do you want to keep the 'Change-Id' in mainline? If you don't mind, I'd like to remove it...

Oops, I forgot to take it out, please do remove it, thanks.

Todd

#4 lore raw

PATCH 1/1 ARM: samsung: adc: fix race in s3c_adc_start

Quoted 7 lines · Todd Poynor
Quoted 2 lines · Kukjin Kim

BTW, Todd, do you want to keep the 'Change-Id' in mainline? If you don't mind, I'd like to remove it...

Oops, I forgot to take it out, please do remove it, thanks.

Sure, will remove when I apply this into -fixes.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.