From 5cef8d8d2948198fbbb2185df7d8670a4d32cee8 Mon Sep 17 00:00:00 2001 From: yongari Date: Wed, 13 Oct 2004 05:45:16 +0000 Subject: Audio drivers failed to detect failure condition and attempted to assign DMA address to the wrong address. It can cause system lockup or other mysterious errors. Since most sound cards requires low DMA address(BUS_SPACE_MAXADDR_24BIT) sndbuf_alloc() would fail when the audio driver is loaded after long running of operations. Approved by: jake (mentor) Reviewed by: truckman, matk --- sys/dev/sound/isa/ad1816.c | 3 ++- sys/dev/sound/isa/ess.c | 2 +- sys/dev/sound/isa/mss.c | 3 ++- sys/dev/sound/isa/sb16.c | 2 +- sys/dev/sound/isa/sb8.c | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) (limited to 'sys/dev/sound/isa') diff --git a/sys/dev/sound/isa/ad1816.c b/sys/dev/sound/isa/ad1816.c index 10ea296..40e006b 100644 --- a/sys/dev/sound/isa/ad1816.c +++ b/sys/dev/sound/isa/ad1816.c @@ -314,7 +314,8 @@ ad1816chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channe ch->parent = ad1816; ch->channel = c; ch->buffer = b; - if (sndbuf_alloc(ch->buffer, ad1816->parent_dmat, ad1816->bufsize) == -1) return NULL; + if (sndbuf_alloc(ch->buffer, ad1816->parent_dmat, ad1816->bufsize) != 0) + return NULL; return ch; } diff --git a/sys/dev/sound/isa/ess.c b/sys/dev/sound/isa/ess.c index ba371e1..1cf756a 100644 --- a/sys/dev/sound/isa/ess.c +++ b/sys/dev/sound/isa/ess.c @@ -557,7 +557,7 @@ esschan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel * ch->parent = sc; ch->channel = c; ch->buffer = b; - if (sndbuf_alloc(ch->buffer, sc->parent_dmat, sc->bufsize) == -1) + if (sndbuf_alloc(ch->buffer, sc->parent_dmat, sc->bufsize) != 0) return NULL; ch->dir = dir; ch->hwch = 1; diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c index d03f7b8..3473766 100644 --- a/sys/dev/sound/isa/mss.c +++ b/sys/dev/sound/isa/mss.c @@ -1131,7 +1131,8 @@ msschan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel * ch->channel = c; ch->buffer = b; ch->dir = dir; - if (sndbuf_alloc(ch->buffer, mss->parent_dmat, mss->bufsize) == -1) return NULL; + if (sndbuf_alloc(ch->buffer, mss->parent_dmat, mss->bufsize) != 0) + return NULL; sndbuf_dmasetup(ch->buffer, (dir == PCMDIR_PLAY)? mss->drq1 : mss->drq2); return ch; } diff --git a/sys/dev/sound/isa/sb16.c b/sys/dev/sound/isa/sb16.c index aa1d416..25ad11c 100644 --- a/sys/dev/sound/isa/sb16.c +++ b/sys/dev/sound/isa/sb16.c @@ -671,7 +671,7 @@ sb16chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel ch->buffer = b; ch->dir = dir; - if (sndbuf_alloc(ch->buffer, sb->parent_dmat, sb->bufsize) == -1) + if (sndbuf_alloc(ch->buffer, sb->parent_dmat, sb->bufsize) != 0) return NULL; return ch; diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c index 1319328..53e508c 100644 --- a/sys/dev/sound/isa/sb8.c +++ b/sys/dev/sound/isa/sb8.c @@ -585,7 +585,7 @@ sbchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c ch->channel = c; ch->dir = dir; ch->buffer = b; - if (sndbuf_alloc(ch->buffer, sb->parent_dmat, sb->bufsize) == -1) + if (sndbuf_alloc(ch->buffer, sb->parent_dmat, sb->bufsize) != 0) return NULL; sndbuf_dmasetup(ch->buffer, sb->drq); return ch; -- cgit v1.1