From e7245381b9488fd2429b3397239fbec9c8882bd9 Mon Sep 17 00:00:00 2001 From: Mathew Kanner Date: Sun, 25 Jan 2004 22:46:22 +0000 Subject: [PATCH] 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 --- sys/dev/sound/pcm/dsp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 1bff6630ae27..91fbb6d26c86 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) {