From: Takashi Iwai Date: Wed, 8 Sep 2010 13:28:19 +0000 (+0200) Subject: ALSA: hda - Clear left-over hp_pins in snd_hda_parse_pin_def_config() X-Git-Tag: v2.6.37-rc1~126^2^2~60 X-Git-Url: https://bbs.cooldavid.org/git/?a=commitdiff_plain;h=03642c9a444079aa13f0864383a8f9ca04bfd198;p=net-next-2.6.git ALSA: hda - Clear left-over hp_pins in snd_hda_parse_pin_def_config() In snd_hda_parse_def_config(), some unused values may remain in hp_pins[] array during the headphone-reassignment workaround. This patch clears the unused array members. Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 2980c277847..bfdde7b0baf 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -4558,6 +4558,8 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, memmove(sequences_hp + i, sequences_hp + i + 1, sizeof(sequences_hp[0]) * (cfg->hp_outs - i)); } + memset(cfg->hp_pins + cfg->hp_outs, 0, + sizeof(hda_nid_t) * (AUTO_CFG_MAX_OUTS - cfg->hp_outs)); } /* sort by sequence */