diff options
author | matk <matk@FreeBSD.org> | 2004-01-25 22:46:22 +0000 |
---|---|---|
committer | matk <matk@FreeBSD.org> | 2004-01-25 22:46:22 +0000 |
commit | 507ddae3aa5dc64a575ea9aeadcd62dca43ba515 (patch) | |
tree | 2234a90d140daa20686830ef4e86ac403747fc8e /sys/dev | |
parent | eb51389e94e1d3ba293e9b0eda2edb66b0ab3f20 (diff) | |
download | FreeBSD-src-507ddae3aa5dc64a575ea9aeadcd62dca43ba515.zip FreeBSD-src-507ddae3aa5dc64a575ea9aeadcd62dca43ba515.tar.gz |
Fix a panic in dsp_clone when trying to access a sound
device that doesn't exists. I'm using my discretion and
committing without mentor approval since Seigo is away.
Noticed by: Maxime Henrion <mux@freebsd.org>
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/sound/pcm/dsp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 1bff663..91fbb6d 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -1093,6 +1093,9 @@ dsp_clone(void *arg, char *name, int namelen, dev_t *dev) pcm_dev = devclass_get_softc(pcm_devclass, unit); + if (pcm_dev == NULL) + return; + SLIST_FOREACH(pcm_chan, &pcm_dev->channels, link) { switch(devtype) { |