From 18f453658f4a4cd26c3b108d30c39d807ef34330 Mon Sep 17 00:00:00 2001 From: Ariff Abdullah Date: Fri, 29 Sep 2006 14:08:53 +0000 Subject: [PATCH] Fix pointer dereference before NULL pointer checking. Noticed by: netchild CID: 243889 Found by: Coverity Prevent (TM) --- sys/dev/sound/pcm/mixer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 2e3c3d5d3579..3e31a6168ddb 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -322,11 +322,13 @@ mixer_set_recroute(struct snd_mixer *m, int route) void mix_setdevs(struct snd_mixer *m, u_int32_t v) { - struct snddev_info *d = device_get_softc(m->dev); + struct snddev_info *d; int i; if (m == NULL) return; + + d = device_get_softc(m->dev); if (d != NULL && (d->flags & SD_F_SOFTPCMVOL)) v |= SOUND_MASK_PCM; for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {