diff options
-rw-r--r-- | sound/core/timer.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c index f0e8b98f346e..d053d70c8d35 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -529,6 +529,16 @@ static int snd_timer_start1(struct snd_timer_instance *timeri, goto unlock; } + /* check the actual time for the start tick; + * bail out as error if it's way too low (< 100us) + */ + if (start) { + if ((u64)snd_timer_hw_resolution(timer) * ticks < 100000) { + result = -EINVAL; + goto unlock; + } + } + if (start) timeri->ticks = timeri->cticks = ticks; else if (!timeri->cticks) |