forked from luck/tmp_suning_uos_patched
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 <toddpoynor@google.com> Acked-by: Ben Dooks <ben-linux@fluff.org> Cc: Stable <stable@vger.kernel.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
This commit is contained in:
parent
bdd3cc26ba
commit
8265981bb4
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user