Skip to contentSkip to conversation

ALSA hda: uninitialized variable fix

PATCH Applied Frederik Deweerdt 2 participants 2 messages Mar 5, 2010 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA hda: uninitialized variable fix

Hello Takashi,

Commit eaa9b3a748539651f50e3a234c8854e1b42a839a introduced the following uninitialized warning:

sound/pci/hda/patch_realtek.c: In function 'set_capture_mixer':
sound/pci/hda/patch_realtek.c:4928: warning: 'pin' is used uninitialized in this function sound/pci/hda/patch_realtek.c:4918: note: 'pin' was declared here

It appears indeed that 'pin' needs to be initialized to 0.

sound/pci/hda/patch_realtek.c +1 -1
index e8cbe21..5c89242 100644
@@ -4915,7 +4915,7 @@ static void fixup_automic_adc(struct hda_codec *codec)
 static void fixup_single_adc(struct hda_codec *codec)
 {
 	struct alc_spec *spec = codec->spec;
-	hda_nid_t pin;
+	hda_nid_t pin = 0;
 	int i;
 
 	/* search for the input pin; there must be only one */
Applied
#1 lore raw

At Fri, 5 Mar 2010 16:34:31 +0100,

Quoted 6 lines · Frederik Deweerdt

Hello Takashi,

Commit eaa9b3a748539651f50e3a234c8854e1b42a839a introduced the following uninitialized warning:

Quoted 7 lines

sound/pci/hda/patch_realtek.c: In function 'set_capture_mixer':
sound/pci/hda/patch_realtek.c:4928: warning: 'pin' is used uninitialized in this function sound/pci/hda/patch_realtek.c:4918: note: 'pin' was declared here

It appears indeed that 'pin' needs to be initialized to 0.

Thanks, applied now.

Takashi

Quoted 14 lines
sound/pci/hda/patch_realtek.c +1 -1
index e8cbe21..5c89242 100644
@@ -4915,7 +4915,7 @@ static void fixup_automic_adc(struct hda_codec *codec)
 static void fixup_single_adc(struct hda_codec *codec)
 {
 	struct alc_spec *spec = codec->spec;
-	hda_nid_t pin;
+	hda_nid_t pin = 0;
 	int i;
 
 	/* search for the input pin; there must be only one */