提交 8265981b 编写于 作者: T Todd Poynor 提交者: Kukjin Kim

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: NTodd Poynor <toddpoynor@google.com>
Acked-by: NBen Dooks <ben-linux@fluff.org>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: NKukjin Kim <kgene.kim@samsung.com>
上级 bdd3cc26
...@@ -157,11 +157,13 @@ int s3c_adc_start(struct s3c_adc_client *client, ...@@ -157,11 +157,13 @@ int s3c_adc_start(struct s3c_adc_client *client,
return -EINVAL; return -EINVAL;
} }
if (client->is_ts && adc->ts_pend)
return -EAGAIN;
spin_lock_irqsave(&adc->lock, flags); 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->channel = channel;
client->nr_samples = nr_samples; client->nr_samples = nr_samples;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册