aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-11-26 17:34:43 -0500
committerTakashi Iwai <tiwai@suse.de>2014-11-27 03:34:41 -0500
commit69eba10e606a80665f8573221fec589430d9d1cb (patch)
treea64f2fe22e666d788d268274f256bdd350f26355
parent51e6f47dd2e3463dac6f37128fd7b7cb40c500de (diff)
ALSA: hda - using uninitialized data
In olden times the snd_hda_param_read() function always set "*start_id" but in 2007 we introduced a new return and it causes uninitialized data bugs in a couple of the callers: print_codec_info() and hdmi_parse_codec(). Fixes: e8a7f136f5ed ('[ALSA] hda-intel - Improve HD-audio codec probing robustness') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_codec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index b2d58998dbdd..2fe86d2e1b09 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -346,8 +346,10 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid,
346 unsigned int parm; 346 unsigned int parm;
347 347
348 parm = snd_hda_param_read(codec, nid, AC_PAR_NODE_COUNT); 348 parm = snd_hda_param_read(codec, nid, AC_PAR_NODE_COUNT);
349 if (parm == -1) 349 if (parm == -1) {
350 *start_id = 0;
350 return 0; 351 return 0;
352 }
351 *start_id = (parm >> 16) & 0x7fff; 353 *start_id = (parm >> 16) & 0x7fff;
352 return (int)(parm & 0x7fff); 354 return (int)(parm & 0x7fff);
353} 355}