From: Todd Poynor Date: Fri, 13 Jul 2012 06:30:48 +0000 (+0900) Subject: ARM: SAMSUNG: fix race in s3c_adc_start for ADC X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8265981bb439f3ecc5356fb877a6c2a6636ac88a;p=linux-beck.git ARM: SAMSUNG: fix race in s3c_adc_start for ADC Checking for adc->ts_pend already claimed should be done with the lock held. Signed-off-by: Todd Poynor Acked-by: Ben Dooks Cc: Stable Signed-off-by: Kukjin Kim --- diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c index 33ecd0c9f0c3..b1e05ccff3ac 100644 --- a/arch/arm/plat-samsung/adc.c +++ b/arch/arm/plat-samsung/adc.c @@ -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;