ALSA: asihpi - Fix uninitialized variable
authorTakashi Iwai <tiwai@suse.de>
Wed, 2 Jun 2010 10:08:37 +0000 (12:08 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 2 Jun 2010 10:08:37 +0000 (12:08 +0200)
Initialize prev_ctl properly before reference:
  sound/pci/asihpi/asihpi.c: In function ‘snd_card_asihpi_mixer_new’:
  sound/pci/asihpi/asihpi.c:2568:30: warning: ‘prev_ctl.dst_node_index’ may be used uninitialized in this function

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/asihpi/asihpi.c

index f74c7372b3d14d3ba553cc8b904dd75585b28bd3..1db586af4f9c8189fda494d2aead7f9c6c22f954 100644 (file)
@@ -2578,6 +2578,9 @@ static int __devinit snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi)
        if (err)
                return -err;
 
+       memset(&prev_ctl, 0, sizeof(prev_ctl));
+       prev_ctl.control_type = -1;
+
        for (idx = 0; idx < 2000; idx++) {
                err = hpi_mixer_get_control_by_index(
                                ss, asihpi->h_mixer,