diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0045-ARM-SAMSUNG-fix-race-in-s3c_adc_start-for-ADC.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0045-ARM-SAMSUNG-fix-race-in-s3c_adc_start-for-ADC.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0045-ARM-SAMSUNG-fix-race-in-s3c_adc_start-for-ADC.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0045-ARM-SAMSUNG-fix-race-in-s3c_adc_start-for-ADC.patch new file mode 100644 index 00000000..be44eb37 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0045-ARM-SAMSUNG-fix-race-in-s3c_adc_start-for-ADC.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 81b7824449f04aec76681f7723b0f7911ad66f11 Mon Sep 17 00:00:00 2001 | ||
2 | From: Todd Poynor <toddpoynor@google.com> | ||
3 | Date: Fri, 13 Jul 2012 15:30:48 +0900 | ||
4 | Subject: [PATCH 045/109] ARM: SAMSUNG: fix race in s3c_adc_start for ADC | ||
5 | |||
6 | commit 8265981bb439f3ecc5356fb877a6c2a6636ac88a upstream. | ||
7 | |||
8 | Checking for adc->ts_pend already claimed should be done with the | ||
9 | lock held. | ||
10 | |||
11 | Signed-off-by: Todd Poynor <toddpoynor@google.com> | ||
12 | Acked-by: Ben Dooks <ben-linux@fluff.org> | ||
13 | Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> | ||
14 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | --- | ||
16 | arch/arm/plat-samsung/adc.c | 8 +++++--- | ||
17 | 1 files changed, 5 insertions(+), 3 deletions(-) | ||
18 | |||
19 | diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c | ||
20 | index 33ecd0c..b1e05cc 100644 | ||
21 | --- a/arch/arm/plat-samsung/adc.c | ||
22 | +++ b/arch/arm/plat-samsung/adc.c | ||
23 | @@ -157,11 +157,13 @@ int s3c_adc_start(struct s3c_adc_client *client, | ||
24 | return -EINVAL; | ||
25 | } | ||
26 | |||
27 | - if (client->is_ts && adc->ts_pend) | ||
28 | - return -EAGAIN; | ||
29 | - | ||
30 | spin_lock_irqsave(&adc->lock, flags); | ||
31 | |||
32 | + if (client->is_ts && adc->ts_pend) { | ||
33 | + spin_unlock_irqrestore(&adc->lock, flags); | ||
34 | + return -EAGAIN; | ||
35 | + } | ||
36 | + | ||
37 | client->channel = channel; | ||
38 | client->nr_samples = nr_samples; | ||
39 | |||
40 | -- | ||
41 | 1.7.7.6 | ||
42 | |||