aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/timer.c')
-rw-r--r--sound/core/timer.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c
index fc144f43faa6..ad153149b231 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -1702,9 +1702,21 @@ static int snd_timer_user_params(struct file *file,
1702 return -EBADFD; 1702 return -EBADFD;
1703 if (copy_from_user(&params, _params, sizeof(params))) 1703 if (copy_from_user(&params, _params, sizeof(params)))
1704 return -EFAULT; 1704 return -EFAULT;
1705 if (!(t->hw.flags & SNDRV_TIMER_HW_SLAVE) && params.ticks < 1) { 1705 if (!(t->hw.flags & SNDRV_TIMER_HW_SLAVE)) {
1706 err = -EINVAL; 1706 u64 resolution;
1707 goto _end; 1707
1708 if (params.ticks < 1) {
1709 err = -EINVAL;
1710 goto _end;
1711 }
1712
1713 /* Don't allow resolution less than 1ms */
1714 resolution = snd_timer_resolution(tu->timeri);
1715 resolution *= params.ticks;
1716 if (resolution < 1000000) {
1717 err = -EINVAL;
1718 goto _end;
1719 }
1708 } 1720 }
1709 if (params.queue_size > 0 && 1721 if (params.queue_size > 0 &&
1710 (params.queue_size < 32 || params.queue_size > 1024)) { 1722 (params.queue_size < 32 || params.queue_size > 1024)) {