aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2012-07-13 15:30:48 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-19 08:58:21 -0700
commit64428b015e0bba23744e2a64a011be9738d05356 (patch)
treef2798a70e184ab3a31e3e74e428c3a981b0575a5 /arch/arm
parent29224d0b695c89e4f4cfc5f1cb3ef3d697c60dc8 (diff)
ARM: SAMSUNG: fix race in s3c_adc_start for ADC
commit 8265981bb439f3ecc5356fb877a6c2a6636ac88a upstream. Checking for adc->ts_pend already claimed should be done with the lock held. Signed-off-by: Todd Poynor <toddpoynor@google.com> Acked-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/plat-samsung/adc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index e8f2be2d67f..df14954aa1c 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -143,11 +143,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;