diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 3cb09d7f504..5f94199e24a 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -1157,7 +1157,7 @@ dsp_clone(void *arg, struct ucred *cred, char *name, int namelen, panic("Unknown devtype %d", devtype); } - if ((pdev->si_drv1 == NULL) && (pdev->si_drv2 == NULL)) { + if ((pdev != NULL) && (pdev->si_drv1 == NULL) && (pdev->si_drv2 == NULL)) { *dev = pdev; dev_ref(*dev); return; diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 6b8dac11dd4..b8f78d3cfab 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -515,7 +515,7 @@ mixer_clone(void *arg, struct ucred *cred, char *name, int namelen, return; if (strcmp(name, "mixer") == 0) { sd = devclass_get_softc(pcm_devclass, snd_unit); - if (sd != NULL) { + if (sd != NULL && sd->mixer_dev != NULL) { *dev = sd->mixer_dev; dev_ref(*dev); }