summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>2000-12-23 06:09:43 +0000
committercg <cg@FreeBSD.org>2000-12-23 06:09:43 +0000
commitf87f7d8216ab9bddcf5a8577c8ae78d0808777c1 (patch)
tree72af408a1151a5c11bc91e00ccc2d0de515fb95f /sys
parent2807ccd53de93c470a0533b0fa6045ac0395df27 (diff)
downloadFreeBSD-src-f87f7d8216ab9bddcf5a8577c8ae78d0808777c1.zip
FreeBSD-src-f87f7d8216ab9bddcf5a8577c8ae78d0808777c1.tar.gz
fix a panic if the requested blocksize was greater than the data rate,
resulting in a divide by 0.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sound/pcm/channel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 9595f85..36a1e72 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -1247,6 +1247,8 @@ chn_setblocksize(pcm_channel *c, int blkcnt, int blksz)
/* adjust for different hw format/speed */
irqhz = (bs->bps * bs->spd) / bs->blksz;
+ if (irqhz < 16)
+ irqhz = 16;
b->blksz = (b->bps * b->spd) / irqhz;
OpenPOWER on IntegriCloud